This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new 9713ad64b3 fix ssl npe (#11093)
9713ad64b3 is described below

commit 9713ad64b3914d45847905cfec7e38d849fdf18d
Author: huazhongming <[email protected]>
AuthorDate: Thu Dec 8 16:04:28 2022 +0800

    fix ssl npe (#11093)
---
 .../remoting/transport/netty4/NettyPortUnificationServerHandler.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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));

Reply via email to