netty: Avoid clearing SSLParameters

Since Netty may have set some parameters already, we should modify the
existing SSLParameters instead of starting from scratch.

This may fix ALPN with JDK9, but full support for ALPN with JDK9 is
still later work and we're not supporting it yet.

Fixes #3532
This commit is contained in:
Eric Anderson 2017-11-07 14:40:42 -08:00
parent 9ecb4c3da7
commit b026ea544c
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ public final class ProtocolNegotiators {
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
SSLEngine sslEngine = sslContext.newEngine(ctx.alloc(), host, port);
SSLParameters sslParams = new SSLParameters();
SSLParameters sslParams = sslEngine.getSSLParameters();
sslParams.setEndpointIdentificationAlgorithm("HTTPS");
sslEngine.setSSLParameters(sslParams);
ctx.pipeline().replace(this, null, new SslHandler(sslEngine, false));