Skip to content

Commit d412c6d

Browse files
committed
Added example to skip hostname verification
1 parent c6cf2e1 commit d412c6d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,12 @@ SSLFactory.builder()
350350

351351
##### Skip hostname validation
352352
```text
353-
SSLFactory.builder()
353+
SSLFactory sslFactory = SSLFactory.builder()
354354
.withDefaultTrustMaterial()
355355
.withUnsafeHostnameVerifier()
356356
.build();
357+
358+
HttpsURLConnection.setDefaultHostnameVerifier(sslFactory.getHostnameVerifier());
357359
```
358360

359361
##### Loading JDK and OS trusted certificates

0 commit comments

Comments
 (0)