From b026ea544c8f2ce48c4a0c0c45b0b1372250a46f Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Tue, 7 Nov 2017 14:40:42 -0800 Subject: [PATCH] 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 --- netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java index c7dc2f3e66..973d7ec33b 100644 --- a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java +++ b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java @@ -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));