我想使用Netty框架创建SSL / TLS连接,该框架将在握手期间一起发送SNI标头。我目前的代码如下:
创建SslContext:
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();
然后在管道创建期间:
pipeline.addLast(sslContext.newHandler(ch.alloc(), cloud.getHostName(), cloud.getPort()));
但是不发送SNI标头。什么是迫使Netty在SSL客户端握手中提供SNI?