I'd like to create an SSL/TLS connection using the Netty framework which will send a SNI header together during handshake. My current code looks like this:
SslContext creation:
TrustManagerFactory trustManagerFactory = SimpleTrustManagerFactory.getInstance(
SimpleTrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init((KeyStore)null);
sslContext = SslContextBuilder
.forClient()
.sslProvider(SslProvider.JDK)
// TODO p0: Ensure all the versions we support have this algorithm installed
.trustManager(trustManagerFactory)
.build();
Then during pipeline creation:
pipeline.addLast(sslContext.newHandler(ch.alloc(), cloud.getHostName(), cloud.getPort()));
However the SNI header is NOT sent. What is missing to force Netty to provide SNI in the SSL Client Handshake?