From bc48c48f1fefd1cb95caa7dcf0643ef3cff1c399 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 30 Sep 2019 17:02:22 +0200 Subject: handle SSLPeerUnverifiedException as certificate error --- app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java index 26f1691c..46782802 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java @@ -49,6 +49,7 @@ import java.util.List; import java.util.NoSuchElementException; import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLPeerUnverifiedException; import okhttp3.OkHttpClient; import se.leap.bitmaskclient.Constants.CREDENTIAL_ERRORS; @@ -578,7 +579,7 @@ public abstract class ProviderApiManagerBase { plainResponseBody = formatErrorMessage(server_unreachable_message); } catch (MalformedURLException e) { plainResponseBody = formatErrorMessage(malformed_url); - } catch (SSLHandshakeException e) { + } catch (SSLHandshakeException | SSLPeerUnverifiedException e) { plainResponseBody = formatErrorMessage(certificate_error); } catch (ConnectException e) { plainResponseBody = formatErrorMessage(service_is_down_error); -- cgit v1.2.3