Is there a way to disable hostname verification for io.netty.handler.ssl.Sslcontext?
I have this code:
sslContext = SslContextBuilder
.forCli
This explains how you can import the certificate of the host you want to connect to: https://stackoverflow.com/a/36483016/5296666
I found that adding setAcceptAnyCertificate(true) to the clientConfig builder did the trick in this way:
sslContext = SslContextBuilder
.forClient()
.sslProvider(SslProvider.JDK)
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
DefaultAsyncHttpClientConfig.Builder builder = new DefaultAsyncHttpClientConfig.Builder();
builder.setSslContext(sslContext)
.setAcceptAnyCertificate(true);
AsyncHttpClientConfig asyncHttpClientConfig = builder.build();
Thanks everyone