Im trying to connect to WSS (client+server certificate authentication + Corporate Proxy Authentication+Self Signed Certificate Chain) from Android.
I tried Autobhan library, Koush AsyncIO, SecureWebSocket, Autobahn library with TLS support And few other.
I could not get it working.
Any suggestions on support library or least possible alterations to my server configuration to make it work (Https mandatory) ?
Always use the secure, encrypted protocol for WebSockets, wss://. ws:// refers to the unsafe WebSockets version (the http:// of WebSockets), and should be avoided for obvious reasons. Let's use Tornado as Server and nv-websocket-client as WebSocket client for Android.
This library supports secure and insecure WebSockets. You just need to define the scheme as wss or ws (case-sensitive) into the URI. When a Ping frame is received, automatically a Pong frame is sent with the same Application Data of the Ping frame.
Jetty: A 2-year-ago email thread in jetty-users mailing list says "We currently have no Android compatible Jetty 9 WebSocket client. There are plans to attempt to backport the Jetty WebSocket Client from JDK 7 to JDK 5/6 for android use, but its a lower priority than finishing our implementation of JSR-356 Java WebSocket API (javax.websocket)."
If you’re using websockets for authenticated users, it is a pretty good idea to only allow authenticated users to establish a successful websocket connection. Don’t allow anyone to establish a connection and then wait for them to authenticate over the websocket itself. First of all, establishing a websocket connection is a bit expensive anyway.
Did you try https://github.com/TooTallNate/Java-WebSocket
I haven't used it myself, but it looks promising.
Just recently discovered this library (nv-websocket-client). The best websocket client library for Android and Java so far. It supports WSS and RFC 7692.
I am using Tyrus library. It works but only on Android 4. On Android 5 it hits a bug in Android. The bug happens only on ssl connections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With