嵌入式 Jetty - 一般 SSLEngine 问题 - SSLv2Hello 禁用错误

Embedded Jetty - General SSLEngine Problem - SSLv2Hello disabled error

当我尝试连接到我的码头服务器时,出现以下错误:

New I/O worker #777, WRITE: SSLv2 client hello message, length = 179
fatal error: 10: General SSLEngine problem
javax.net.ssl.SSLHandshakeException: SSLv2Hello is disabled
SEND TLSv1.2 ALERT:  fatal, description = unexpected_message
WRITE: TLSv1.2 Alert, length = 2
fatal: engine already closed.  Rethrowing javax.net.ssl.SSLHandshakeException: SSLv2Hello is disabled
New I/O worker #777, called closeOutbound()
New I/O worker #777, closeOutboundInternal()
New I/O worker #777, SEND TLSv1.2 ALERT:  warning, description = close_notify
New I/O worker #777, WRITE: TLSv1.2 Alert, length = 2

使用 Java 1.8.241。 使用配置为使用 SSL 的 Jetty (v9.2.9) 服务器。 服务器使用的是自签名证书,我已将其导入密钥库并 cacerts.Connecting 使用 wAsync Atmosphere 客户端将其导入服务器。

为了创建自签名证书,我以管理员身份在命令提示符下使用了以下命令:

keytool -genkeypair -alias jetty_cloud -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore jetty_cloud.p12 -validity 3650
keytool -genkeypair -alias jetty_cloud -keyalg RSA -keysize 2048 -keystore jetty_cloud.jks -validity 3650
keytool -importkeystore -srckeystore jetty_cloud.jks -destkeystore jetty_cloud.p12 -deststoretype pkcs12
keytool -export -alias jetty_cloud -file jetty_cloud.crt -keystore jetty_cloud.jks
keytool -import -alias jetty_cloud -file "C:\Program Files\Java\jre1.8.0_241\bin\jetty_cloud.crt" -keystore "C:\Program Files\Java\jre1.8.0_241\lib\security\cacerts" -storepass changeit

SSLv2Hello 默认在 Java 7+

上禁用

参见:https://www.oracle.com/java/technologies/compatibility.html

您的客户端,即 Async Atmosphere 客户端,需要配置或升级以使用更新的 SSL/TLS 设置。

建议针对 TLSv1.2 或更高版本的客户端配置。 (意味着 SSL、SSLv2、SSLv3、TLSv1.0 和 TLSv1.1 在客户端都被禁用)