diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java index 3d22ce7a03..338f3572d1 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java +++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyPortUnificationServerHandler.java @@ -138,7 +138,9 @@ public class NettyPortUnificationServerHandler extends ByteToMessageDecoder { private void enableSsl(ChannelHandlerContext ctx) { ChannelPipeline p = ctx.pipeline(); - p.addLast("ssl", sslCtx.newHandler(ctx.alloc())); + if (sslCtx != null) { + p.addLast("ssl", sslCtx.newHandler(ctx.alloc())); + } p.addLast("unificationA", new NettyPortUnificationServerHandler(url, sslCtx, false, protocols, handler, dubboChannels, urlMapper, handlerMapper));