javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

关于javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure错误解决方法:
https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https

通过增加VM参数:-Djavax.net.debug=all
你将可以看到证书打印日志,其中有一段错误信息SSLv2 :

http-8280-1, WRITE: SSLv2 client hello message, length = 110
[Raw write]: length = 112
0000: 80 6E 01 03 01 00 45 00   00 00 20 00 00 04 01 00  .n....E... .....
0010: 80 00 00 05 00 00 2F 00   00 35 00 00 33 00 00 39  ....../..5..3..9
0020: 00 00 32 00 00 38 00 00   0A 07 00 C0 00 00 16 00  ..2..8..........
0030: 00 13 00 00 09 06 00 40   00 00 15 00 00 12 00 00  .......@........
0040: 03 02 00 80 00 00 08 00   00 14 00 00 11 00 00 FF  ................
0050: 57 DF 9A C3 76 1B 34 71   96 A9 04 83 F8 2C 4F 8E  W...v.4q.....,O.
0060: 3B 49 02 9C 7E 2C 1D 93   D3 35 56 C2 16 1F 8B 1B  ;I...,...5V.....
[Raw read]: length = 5
0000: 15 03 01 00 02                                     .....
[Raw read]: length = 2
0000: 02 28                                              .(
http-8280-1, READ: TLSv1 Alert, length = 2
http-8280-1, RECV TLSv1 ALERT:  fatal, handshake_failure
http-8280-1, called closeSocket()

通过设置VM参数:-Dhttps.protocols=SSLv3,TLSv1 解决

你可能感兴趣的:(javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure)