Netty skips hostname validation when we use trust manager with trustCertCollectionFile

19 views
Skip to first unread message

jai.a...@gmail.com

unread,
Feb 5, 2018, 7:59:00 PM2/5/18
to Netty discussions

I am using io netty version 4.1.19.Final

I am trying to set up a client which will connect to a server using TLS.

I want the netty to perform hostname validation when it receives TLS certificates, but it looks like since I am using a custom trustManager using TLS Trust file path netty skips hostname validation completely.

Is there a way for me to specify a custom trustManager using TLS Trust file path AND have io netty perform hostname validation????

SslContextBuilder builder = SslContextBuilder.forClient();
File trustCertCollection = new File(conf.getTlsTrustCertsFilePath());
builder.trustManager(trustCertCollection);

Netty API:- https://netty.io/4.0/api/io/netty/handler/ssl/SslContextBuilder.html#trustManager-java.io.File-

Full code:- https://github.com/apache/incubator-pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionPool.java#L97



Have posted the same question on stack overflow:-

https://stackoverflow.com/questions/48630448/netty-skips-hostname-validation-when-we-use-trust-manager-with-trustcertcollecti

Reply all
Reply to author
Forward
0 new messages