0%

Java调用SSL异常,javax.net.ssl.SSLHandshakeException: No appropriate protocol

现象

jdk从1.7升级到1.8后,程序运行报错,错误信息如下

1
2
3
4
5
6
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.Handshaker.activate(Handshaker.java:529)
at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1492)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1361)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)

问题原因

jdk1.8版本导致SSL调用权限上有问题

解决方案

找到jdk安装目录,jre\lib\security\java.security,找到对应的SSLv3,删除掉,重启项目即可。

5d37bacb3db1714271