【发布时间】:2016-10-21 14:32:37
【问题描述】:
我遇到以下 SSL 异常:
ERROR STDERR - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1822)
SSL 调试日志如下:
INFO STDOUT - http-10.8.184.11-8080-14, WRITE: TLSv1 Handshake, length = 81
2016-10-21 07:26:37,499 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, WRITE: SSLv2 client hello message, length = 110
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, READ: Unknown-3.3 Alert, length = 2
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - , RECV TLSv1 ALERT:
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - fatal,
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - handshake_failure
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, called closeSocket()
2016-10-21 07:26:37,501 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, called close()
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] INFO STDOUT - http-10.8.184.11-8080-14, called closeInternal(true)
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
2016-10-21 07:26:37,502 [http-10.8.184.11-8080-14] ERROR STDERR - at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
【问题讨论】:
-
您使用的是自签名证书吗?好像您正在发送针对
https的httpinsted 的请求,我们可以看一下代码sn-p 吗?什么是应用程序类型?它是标准的 java、ee 还是 android? -
已经存在很多关于这种握手失败的问题。请查看这些问题,如果您在此处找不到答案,请发布足够的信息,清楚说明您的问题与所有其他问题有何不同,以及为什么其他问题无法解决您的问题。此外,如果您希望其他人免费帮助您,请使用正确的格式而不是当前转储。