CN1模拟器上的SSL握手问题

时间:2019-04-16 11:04:40

标签: ssl codenameone

我的Windows服务器正在将TLS 1.2用于Java客户端。我在模拟器执行过程中定期收到以下错误。请提供解决方案的建议

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
        at com.codename1.impl.javase.JavaSEPort.getResponseCode(JavaSEPort.java:8333)
        at com.codename1.io.ConnectionRequest.performOperation(ConnectionRequest.java:773)
        at com.codename1.io.NetworkManager$NetworkThread.run(NetworkManager.java:325)
        at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at sun.security.ssl.InputRecord.read(InputRecord.java:505)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)

1 个答案:

答案 0 :(得分:0)

That's a connection problem that's propagated from JavaSE's networking code. It generally means the server and client had issues in SSL. See this article on various suggested workarounds: https://dzone.com/articles/troubleshooting-javaxnetsslsslhandshakeexception-r