gusavila92 / java-android-websocket-client

Java/Android WebSocket Client
Apache License 2.0
148 stars 40 forks source link

Use TLSv1.2 in Android 5 and 6 #23

Closed JorgeDiazP closed 2 years ago

JorgeDiazP commented 3 years ago

Hi,

I'm using Kuzzle that uses this library as dependency in his Android SDK to create a WebSocket.

I have to do a connection to a server with TLSv1.2. It works except for Android 5 and 6 versions. I've been trying, after Kuzzle creates a WebSocketClient to set an SSLFactory to force to use TLSv1.2 without success.

Any help would be appreciated.

gusavila92 commented 2 years ago

I was testing it and I don't see any issue with the library. The TLS handshake is a very complex process and to debug it you can use Wireshark to see in which point the connection is being dropped. Do a deep investigation about the TLS handshake as well as the JSSE reference guide, and try to create you own SSLSocketFactory. For Android I also recommend using ProviderInstaller to install the latest patches and as a last resort enable TLSv1.0 on the server along with the old cipher suites