java - 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
解决方案
SSLv2Hello
在 Java 7+ 上默认禁用
请参阅:https ://www.oracle.com/java/technologies/compatibility.html
您的客户端(Async Atmosphere 客户端)需要配置或升级以使用更新的 SSL/TLS 设置。
建议以 TLSv1.2 或更高版本的客户端配置为目标。(意味着 SSL、SSLv2、SSLv3、TLSv1.0 和 TLSv1.1 在客户端都被禁用)
推荐阅读
- python - python数据框中的平等
- python-3.x - 如何根据其他数据框的行将新列添加到数据框中?
- reactjs - 在反应中动态加载 svgs 作为组件
- spring-integration - 如何处理spring集成中的错误
- jquery - 如何根据 select onChange 事件更新 jQuery datetimepicker
- azure - 如何不为磁盘多收费用?
- react-native - React Native - 警告:可能未处理的承诺拒绝(id:0)
- .net - EPPLus [Nuget] 依赖项
- java - 在方法完成之前未写入 DB 上的 JPA 更改
- objective-c - 连接 airpods 时扬声器不是可用输入