diff options
author | cyBerta <cyberta@riseup.net> | 2023-08-03 16:53:56 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-08-03 16:53:56 +0200 |
commit | f5b9e59110c08b2d1de7f1c2ba8c9568fad71f8c (patch) | |
tree | cba6a0cecd8965ccfb99610b07448b83b0a525cb /app | |
parent | 2b2d80d37ee43a98f04edd5a4c80042aeb834622 (diff) |
increase okhttp client timout for connect and read to increase the chance to receive the setup config data from slow provider api servers
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/providersetup/connectivity/OkHttpClientGenerator.java | 4 |
1 files changed, 4 insertions, 0 deletions
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(); } |