Skip to content

Commit d178f31

Browse files
docs: add note about TLS versions
Related: #298
1 parent b43819e commit d178f31

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/site/markdown/faq.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,30 @@ Sticky sessions can be enabled on AWS Application Load Balancers, which works by
121121
Please see [above](#how-to-deal-with-cookies) for how to deal with cookies.
122122

123123
Reference: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
124+
125+
## How to force TLS v1.2 and above
126+
127+
This library relies on the OkHttp library to create HTTP requests and WebSocket connections.
128+
129+
Reference: https://square.github.io/okhttp/
130+
131+
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).
132+
133+
You can overwrite it by providing your own OkHttp client:
134+
135+
```java
136+
OkHttpClient okHttpClient = new OkHttpClient.Builder()
137+
.connectionSpecs(Arrays.asList(
138+
ConnectionSpec.RESTRICTED_TLS
139+
))
140+
.readTimeout(1, TimeUnit.MINUTES) // important for HTTP long-polling
141+
.build();
142+
143+
IO.Options options = new IO.Options();
144+
options.callFactory = okHttpClient;
145+
options.webSocketFactory = okHttpClient;
146+
147+
Socket socket = IO.socket(URI.create("https://example.com"), options);
148+
```
149+
150+
Note: we will upgrade to OkHttp 4 in the next major version.

src/site/markdown/installation.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ implementation ('io.socket:socket.io-client:2.0.1') {
3131
exclude group: 'org.json', module: 'json'
3232
}
3333
```
34+
35+
## Dependency tree
36+
37+
| `socket.io-client` | `engine.io-client` | `okhttp` |
38+
|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
39+
| `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` |
40+
| `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` |
41+
| `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)) |
42+
| `1.0.0` | `1.0.0` | `3.8.1` |

0 commit comments

Comments
 (0)