首页 > 解决方案 > Embedded Jetty - 一般 SSLEngine 问题 - SSLv2Hello disabled 错误

问题描述

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

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。使用 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

标签: javasslhttpsembedded-jettyatmosphere

解决方案


SSLv2Hello在 Java 7+ 上默认禁用

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

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

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


推荐阅读