TubeSock icon indicating copy to clipboard operation
TubeSock copied to clipboard

Cannot connect to websocket on Android 4

Open LucaAndrei opened this issue 7 years ago • 3 comments

I have created an Android application that uses this package and whenever I try to call connect on the websocket I get the following error :

03-20 11:21:50.005 4255-4270/? W/System.err﹕ com.firebase.tubesock.WebSocketException: error while creating secure socket to wss://fitnessmd.now.sh:443/websocket 03-20 11:21:50.010 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket.createSocket(WebSocket.java:275) 03-20 11:21:50.010 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket.runReader(WebSocket.java:306) 03-20 11:21:50.010 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket.access$000(WebSocket.java:30) 03-20 11:21:50.010 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket$2.run(WebSocket.java:108) 03-20 11:21:50.010 4255-4270/? W/System.err﹕ at java.lang.Thread.run(Thread.java:841) 03-20 11:21:50.010 4255-4270/? W/System.err﹕ Caused by: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate 03-20 11:21:50.015 4255-4270/? W/System.err﹕ at com.android.org.conscrypt.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:146) 03-20 11:21:50.015 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket.verifyHost(WebSocket.java:285) 03-20 11:21:50.015 4255-4270/? W/System.err﹕ at com.firebase.tubesock.WebSocket.createSocket(WebSocket.java:271) 03-20 11:21:50.015 4255-4270/? W/System.err﹕ ... 4 more

I have found the next StackOverflow solution to the issue : http://stackoverflow.com/questions/28855164/fixing-javax-net-ssl-sslpeerunverifiedexception-no-peer-certificate

Do you think there is a way that I can call the "setHostname" method on the WebSocket object?

LucaAndrei avatar Mar 20 '17 09:03 LucaAndrei

FYI- This repo is not receiving active development. Your best bet may be to fork it if you need changes.

mikelehen avatar Mar 20 '17 16:03 mikelehen

Oh, ok, no problem I'm gonna leave this issue here in case somebody runs into it. Is it okay?

LucaAndrei avatar Mar 21 '17 06:03 LucaAndrei

Of course! I just wanted to give you a heads-up.

mikelehen avatar Mar 21 '17 14:03 mikelehen