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
Failure in SSL library or Connection Hangs #719
Comments
Hello @TestTito, thank you very much for your bug report. Do you think this issue is caused by https://github.com/TooTallNate/Java-WebSocket/wiki/FAQ:-Secure-WebSockets#handshake-error-on-android? SSl on Android is sometimes very buggy, so it could be related to this. Best regards, |
Yeah I did the customSSL the only protocols left are TLSV1.2 TLSV1.1 and TLSV1 So I don't know why it keeps having some SSL exceptions when i am suppose to use TLS? I tryed to use SSLSocketChannel and SSLSocketChannel2 both outputs the same error. I am out of ideas :( thanks for your reply. |
@marci4 Hi, I have tested AndroidAsync from Koush just to know if it wss works well. It is WAY more stable on the WSS then this one I am wondering if we could compare the ssl implementation inside Koush one to find the clue of the exceptions? |
Hello @TestTito, since I am very busy in RL, I do not have the time for this! Best regards, |
Please try a different version of JRE. This is how I did when I found this issue. And please let me know if it doesn't work for you. |
Expected Behavior
Trying to connect to the secure websocketserver (wss) the first time i start the app it always work.
Then after a few connection/reconnections, it becomes unstable.
When I try to connect it just hangs and nothing shows up on server side or SSl error described below.
The server and web application works perfectly if i start everything without https/wss
Current Behavior
The Wss connection hangs and is not reachable after a few attemps 2-3
I stress test too with simple websocket client extension in chrome
and it does the same, sometimes it just hangs, and then the wss is not reachable for a few seconds.
Possible Solution
no idea I tryed to debug in unwrap() and read() of SSLSocketchannel function but i can't seem to find a problem there
Steps to Reproduce (for bugs)
1.open chrome on my webpage or client websocket chrome extension
2.open/close a connection multiple times
3.it will hang after 2-3 connection attempts
4.
Debug log (for bugs)
06-06 14:55:13.638 18568-18711/com.regulvar.remotecontroller I/System.out: Removing connection which is not in the connections collection! Possible no handshake recieved! org.java_websocket.WebSocketImpl@ea78735
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: javax.net.ssl.SSLException: javax.net.ssl.SSLProtocolException: Read error: ssl=0xdc81ba80: Failure in SSL library, usually a protocol error
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: error:100bd10c:SSL routines:ssl3_get_record:WRONG_VERSION_NUMBER (external/boringssl/src/ssl/s3_pkt.c:305 0xed92976f:0x00000000)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at com.android.org.conscrypt.OpenSSLEngineImpl.unwrap(OpenSSLEngineImpl.java:497)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:1014)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at org.java_websocket.SSLSocketChannel.read(SSLSocketChannel.java:158)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at org.java_websocket.SocketChannelIOHelper.read(SocketChannelIOHelper.java:38)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:406)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at java.lang.Thread.run(Thread.java:818)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: Caused by: javax.net.ssl.SSLProtocolException: Read error: ssl=0xdc81ba80: Failure in SSL library, usually a protocol error
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: error:100bd10c:SSL routines:ssl3_get_record:WRONG_VERSION_NUMBER (external/boringssl/src/ssl/s3_pkt.c:305 0xed92976f:0x00000000)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_read_BIO(Native Method)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: at com.android.org.conscrypt.OpenSSLEngineImpl.unwrap(OpenSSLEngineImpl.java:477)
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller W/System.err: ... 5 more
06-06 14:55:16.188 18568-18711/com.regulvar.remotecontroller I/System.out: Removing connection which is not in the connections collection! Possible no handshake recieved! org.java_websocket.WebSocketImpl@7726d3b
Context
Trying to connect from a Web Page and establish a simple wss connection to exchange some datas and commands.
Your Environment
I created my Certificate with this line:
keytool -genkey -validity 3650 -keystore "keystore.jks" -storepass "password"
// -keypass "password" -alias "company" -keyalg RSA –keysize 2048 -dname "CN=domain,
// OU=RD, O=company, L=town, S=province, C=country"
and then I convert the jks to bks with the portecle application
Well I hope i gave enough information let me know if you guys need something else.
Thank you
David
The text was updated successfully, but these errors were encountered: