diff --git a/src/site/markdown/faq.md b/src/site/markdown/faq.md index a79fb47..cccb71e 100644 --- a/src/site/markdown/faq.md +++ b/src/site/markdown/faq.md @@ -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. diff --git a/src/site/markdown/installation.md b/src/site/markdown/installation.md index 532dc4d..c4eef2a 100644 --- a/src/site/markdown/installation.md +++ b/src/site/markdown/installation.md @@ -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` |