javax.net.ssl.SSLHandshakeException

javax.net.ssl.SSLHandshakeException

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:980) ~[na:1.8.0_45]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) ~[na:1.8.0_45]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) ~[na:1.8.0_45]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375) ~[na:1.8.0_45]
        at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:351) ~[okhttp-4.2.2.jar:na]
        at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:310) ~[okhttp-4.2.2.jar:na]
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:178) ~[okhttp-4.2.2.jar:na]
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:236) ~[okhttp-4.2.2.jar:na]
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:109) ~[okhttp-4.2.2.jar:na]

解决办法升级jdk版本或者修改jdk文件
1、对于服务器来说要支持域名并且不进行ssl证书校验,需要升级到jdk1.8的201版本及以上
2、修改…\Java\JDK\jre\lib\security目录下java.security文件,添加下面语句到文件内容中

#crypto.policy=unlimited

你可能感兴趣的:(Java,ssl,网络协议,网络)