Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSLHandshakeException is caught when connect socket #1195

Closed
4Mi opened this issue Nov 9, 2021 · 1 comment
Closed

SSLHandshakeException is caught when connect socket #1195

4Mi opened this issue Nov 9, 2021 · 1 comment

Comments

@4Mi
Copy link

4Mi commented Nov 9, 2021

Precondition:
1.wireless signal is instability
2.set ConnectionLostTimeout to 15 seconds
3.url: "wss://..."

Reproduce step:
1.onClose is called because pong message has not been received in time:
onClose code: 1006 reason: The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection remote: false

2.after 5 seconds, create a new socket with connect timeout parameter(5s) and call connect method as following:
public MySocket(URI serverUri) {
super(serverUri, new Draft_6455(), null, 5000);
}
3.after calling socket.connect(), the onOpen is not called, but after 15 minutes, onError is called with following stack:
onError e: javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0x8f209c80: I/O error during system call, Connection timed out
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:324)
at com.android.org.conscrypt.OpenSSLSocketImpl.waitForHandshake(OpenSSLSocketImpl.java:629)
at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:591)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:407)
at java.lang.Thread.run(Thread.java:818)
4.Also during the 15 minutes, i try closing the opening socket, but the onClose is not called, nothing happened
after calling socket.close().

Expected behavior
I think the onError should be called after 5 seconds after calling connect.

Debug log:

Environment:

  • Java version:1.8
  • Operating System and version:Android 6.0
@marci4
Copy link
Collaborator

marci4 commented Nov 9, 2021

Duplicates #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants