From f5b9e59110c08b2d1de7f1c2ba8c9568fad71f8c Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 3 Aug 2023 16:53:56 +0200 Subject: increase okhttp client timout for connect and read to increase the chance to receive the setup config data from slow provider api servers --- .../providersetup/connectivity/OkHttpClientGenerator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/connectivity/OkHttpClientGenerator.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/connectivity/OkHttpClientGenerator.java index 97393551..b0dbd49b 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/connectivity/OkHttpClientGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/connectivity/OkHttpClientGenerator.java @@ -43,10 +43,12 @@ import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.cert.CertificateException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.concurrent.TimeUnit; import okhttp3.CipherSuite; import okhttp3.ConnectionSpec; @@ -139,6 +141,8 @@ public class OkHttpClientGenerator { clientBuilder.dns(new DnsResolver(clientBuilder.build(), true)); sslCompatFactory.initSSLSocketFactory(clientBuilder); + clientBuilder.connectTimeout(45L, TimeUnit.SECONDS); + clientBuilder.readTimeout(45L, TimeUnit.SECONDS); return clientBuilder.build(); } -- cgit v1.2.3