docs: add note about TLS versions
Related: https://github.com/socketio/socket.io-client-java/issues/298
This commit is contained in:
@@ -121,3 +121,30 @@ Sticky sessions can be enabled on AWS Application Load Balancers, which works by
|
||||
Please see [above](#how-to-deal-with-cookies) for how to deal with cookies.
|
||||
|
||||
Reference: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
|
||||
|
||||
## How to force TLS v1.2 and above
|
||||
|
||||
This library relies on the OkHttp library to create HTTP requests and WebSocket connections.
|
||||
|
||||
Reference: https://square.github.io/okhttp/
|
||||
|
||||
We currently depend on version `3.12.12`, which is the last version that supports Java 7+ and Android 2.3+ (API level 9+). With this version, the OkHttpClient allows `TLSv1` and `TLSv1.1` by default ([MODERN_TLS](https://square.github.io/okhttp/security/tls_configuration_history/#modern_tls-versions_1) configuration).
|
||||
|
||||
You can overwrite it by providing your own OkHttp client:
|
||||
|
||||
```java
|
||||
OkHttpClient okHttpClient = new OkHttpClient.Builder()
|
||||
.connectionSpecs(Arrays.asList(
|
||||
ConnectionSpec.RESTRICTED_TLS
|
||||
))
|
||||
.readTimeout(1, TimeUnit.MINUTES) // important for HTTP long-polling
|
||||
.build();
|
||||
|
||||
IO.Options options = new IO.Options();
|
||||
options.callFactory = okHttpClient;
|
||||
options.webSocketFactory = okHttpClient;
|
||||
|
||||
Socket socket = IO.socket(URI.create("https://example.com"), options);
|
||||
```
|
||||
|
||||
Note: we will upgrade to OkHttp 4 in the next major version.
|
||||
|
||||
@@ -31,3 +31,12 @@ implementation ('io.socket:socket.io-client:2.0.1') {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
}
|
||||
```
|
||||
|
||||
## Dependency tree
|
||||
|
||||
| `socket.io-client` | `engine.io-client` | `okhttp` |
|
||||
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
|
||||
| `2.0.1` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-2.0.0...socket.io-client-2.0.1)) | `2.0.0` | `3.12.12` |
|
||||
| `2.0.0` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-1.0.1...socket.io-client-2.0.0)) | `2.0.0` ([diff](https://github.com/socketio/engine.io-client-java/compare/engine.io-client-1.0.1...engine.io-client-2.0.0)) | `3.12.12` |
|
||||
| `1.0.1` ([diff](https://github.com/socketio/socket.io-client-java/compare/socket.io-client-1.0.0...socket.io-client-1.0.1)) | `1.0.1` ([diff](https://github.com/socketio/engine.io-client-java/compare/engine.io-client-1.0.0...engine.io-client-1.0.1)) | `3.12.12` ([changelog](https://square.github.io/okhttp/changelogs/changelog_3x/#version-31212)) |
|
||||
| `1.0.0` | `1.0.0` | `3.8.1` |
|
||||
|
||||
Reference in New Issue
Block a user