Commit 884ba6d
authored
Fall back to OkHostnameVerifier for default SSL verification (#1043)
* Add failing test for hostname verifier fallback
When allowedHostnames is configured, the custom hostname verifier
doesn't fall back to default OkHttp verification. This breaks SSL
verification for sites using wildcard/SAN certificates.
The test demonstrates that after configuring an allowed hostname
override, requests to other valid SSL sites (google.com) fail with
SSL errors instead of succeeding.
* Fall back to OkHostnameVerifier for default SSL verification
The custom WpRequestExecutorHostnameVerifier now falls back to
OkHostnameVerifier when the hostname is not in the allowlist.
This ensures proper handling of wildcard certificates and SANs
while still allowing custom hostname overrides.
Changes:
- Import OkHostnameVerifier from okhttp3.internal.tls
- Check custom allowlist first, then fall back to default verification
- Remove conditional verifier application (always use our verifier)1 parent 691cb72 commit 884ba6d
File tree
2 files changed
+35
-8
lines changed- native/kotlin/api/kotlin/src
- integrationTest/kotlin
- main/kotlin/rs/wordpress/api/kotlin
2 files changed
+35
-8
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
300 | 325 | | |
301 | 326 | | |
302 | 327 | | |
| |||
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
0 commit comments