diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java index bd85b7a0a..8048f1fea 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/HkpKeyserver.java @@ -209,8 +209,13 @@ public class HkpKeyserver extends Keyserver { Log.w(Constants.TAG, e); } - client.setProxy(proxy); - client.setConnectTimeout(proxy != null ? 30000 : 5000, TimeUnit.MILLISECONDS); + if (proxy != null) { + client.setProxy(proxy); + client.setConnectTimeout(30000, TimeUnit.MILLISECONDS); + } else { + client.setProxy(Proxy.NO_PROXY); + client.setConnectTimeout(5000, TimeUnit.MILLISECONDS); + } client.setReadTimeout(45000, TimeUnit.MILLISECONDS); return client; |