我的eclipse插件应用程序仍然获得SSLProtocolException:握手警报:java版本“1.8.0_141”上的unrecognized_name虽然我已经按照一些提示来禁用SNI扩展。
[INFO] Property jsse.enableSNIExtension=false
[FATAL] javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.security.ssl.ClientHandshaker.handshakeAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
请帮我解决这个案子,谢谢。
如果使用SNI发送的名称是意外的,则服务器可能会发回unrecognized_name警报。但是如果服务器需要使用SNI并且客户端没有发送服务器名称,它也可能会被发回。因此,禁用SNI可以触发第二种情况,即服务器需要SNI,但客户端不提供SNI。
处理此错误的正确方法是使用SNI扩展并将名称设置为服务器预期的名称。