restore the connect timeout feature

This commit is contained in:
Athou
2023-12-22 16:04:25 +01:00
parent a35f55cde6
commit 5601d150c3
2 changed files with 14 additions and 2 deletions

View File

@@ -101,10 +101,11 @@ public class HttpGetter {
return new HttpResult(content, contentType, lastModifiedHeader, eTagHeader, duration, urlAfterRedirect);
}
public static HttpClient newClient() {
private HttpClient newClient() {
SSLFactory sslFactory = SSLFactory.builder().withUnsafeTrustMaterial().withUnsafeHostnameVerifier().build();
return HttpClient.newBuilder()
.version(Version.HTTP_1_1)
.connectTimeout(Duration.ofSeconds(5))
.followRedirects(Redirect.ALWAYS)
.sslContext(sslFactory.getSslContext())
.sslParameters(sslFactory.getSslParameters())