From 4a0f25875f707e42a6b92c3071d3c8ba309abe5c Mon Sep 17 00:00:00 2001 From: zhanxuefeng Date: Tue, 10 May 2022 16:04:10 +0800 Subject: [PATCH] [ISSUE #4273] NettyRemotingClient get tls conf from system properties --- .../apache/rocketmq/remoting/netty/NettyRemotingClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java index 5ced3b7eb4d..57b527c4cb6 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java @@ -129,7 +129,7 @@ public Thread newThread(Runnable r) { } }); - if (nettyClientConfig.isUseTLS()) { + if (nettyClientConfig.isUseTLS() || TlsSystemConfig.tlsEnable) { try { sslContext = TlsHelper.buildSslContext(true); log.info("SSL enabled for client"); @@ -170,7 +170,7 @@ public Thread newThread(Runnable r) { @Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); - if (nettyClientConfig.isUseTLS()) { + if (nettyClientConfig.isUseTLS() || TlsSystemConfig.tlsEnable) { if (null != sslContext) { pipeline.addFirst(defaultEventExecutorGroup, "sslHandler", sslContext.newHandler(ch.alloc())); log.info("Prepend SSL handler");