Skip to content

Commit a906598

Browse files
authored
fix(ok_http): trust manager init (#1830)
1 parent 54dfd63 commit a906598

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgs/ok_http/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `OKHttpClient` supports client certificates.
88
- Support `package:web_socket` 1.0.0.
99
- Set `minSdk=24`.
10+
- Add a missing call to `TrustManagerFactory.init`.
1011

1112
## 0.1.0
1213

pkgs/ok_http/lib/src/ok_http_client.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ class OkHttpClient extends BaseClient {
260260
if (!configuration.validateServerCertificates) {
261261
trustManagers[0] = _allAllTrustManager;
262262
} else {
263-
final tms = bindings.TrustManagerFactory.getInstance(
264-
bindings.TrustManagerFactory.getDefaultAlgorithm())!
265-
.getTrustManagers()!;
263+
final tmf = bindings.TrustManagerFactory.getInstance(
264+
bindings.TrustManagerFactory.getDefaultAlgorithm())!
265+
..init(null);
266+
final tms = tmf.getTrustManagers()!;
266267
if (tms.length != 1) {
267268
throw StateError('unexpected XXX');
268269
}

0 commit comments

Comments
 (0)