【发布时间】:2021-01-05 06:42:21
【问题描述】:
我们使用的是 Redisson 客户端,它使用 netty 连接到 Redis 服务器。使用 netty 4.1.42.Final,一切正常。但是升级到 netty 4.1.48.Final 后,TLSv1 ClientHello 被发送,因此无法连接到服务器。尝试通过设置 jdk.tls.client.protocols 系统属性来指定 TLSv1.2,但 netty 似乎没有兑现它。
打开 Java 跟踪后,在跟踪文件中可以看到以下内容:
使用 netty 4.1.48,默认协议只有 TLSv1:
jdk.tls.client.protocols is defined as TLSv1.2
SSLv3 protocol was requested but was not enabled
SUPPORTED: [TLSv1, TLSv1.1, TLSv1.2]
SERVER_DEFAULT: [TLSv1, TLSv1.1, TLSv1.2]
CLIENT_DEFAULT: [TLSv1.2]
IBMJSSE2 will enable CBC protection
12:00:41.624 [redisson-netty-2-9] DEBUG io.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1]
使用 netty 4.1.42,默认协议包括 TLSv1.2:
jdk.tls.client.protocols is defined as null
SSLv3 protocol was requested but was not enabled
SSLv3 protocol was requested but was not enabled
SUPPORTED: [TLSv1, TLSv1.1, TLSv1.2]
SERVER_DEFAULT: [TLSv1, TLSv1.1, TLSv1.2]
CLIENT_DEFAULT: [TLSv1, TLSv1.1, TLSv1.2]
10:18:00.008 [redisson-netty-2-23] DEBUG io.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1.2, TLSv1.1, TLSv1]
未设置 jdk.tls.client.protocols 系统属性时的 netty 4.1.48 跟踪:
jdk.tls.client.protocols is defined as null
SSLv3 protocol was requested but was not enabled
SSLv3 protocol was requested but was not enabled
SUPPORTED: [TLSv1, TLSv1.1, TLSv1.2]
SERVER_DEFAULT: [TLSv1, TLSv1.1, TLSv1.2]
CLIENT_DEFAULT: [TLSv1, TLSv1.1, TLSv1.2]
IBMJSSE2 will enable CBC protection
09:54:19.626 [redisson-netty-2-25] DEBUG io.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1]
java -version 输出:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 8.0.5.27 - pwa6480sr5fp27-20190104_01(SR5 FP27))
IBM J9 VM (build 2.9, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20181219_405297 (JIT enabled, AOT enabled)
OpenJ9 - 3f2d574
OMR - 109ba5b
IBM - e2996d1)
JCL - 20190104_01 based on Oracle jdk8u191-b26
还有其他人遇到此问题或知道如何解决此问题吗?
谢谢!
【问题讨论】:
-
您是否可以添加不使用 netty 4.1.48.Final 指定系统属性时记录的内容?
-
另外请添加有关使用的java版本的详细信息:
java -version -
我用 trace 和 Java 版本更新了帖子。