diff --git a/emailcommon/src/com/android/emailcommon/utility/SSLUtils.java b/emailcommon/src/com/android/emailcommon/utility/SSLUtils.java index aa5229aec..b21c68f33 100644 --- a/emailcommon/src/com/android/emailcommon/utility/SSLUtils.java +++ b/emailcommon/src/com/android/emailcommon/utility/SSLUtils.java @@ -74,7 +74,11 @@ public class SSLUtils { if (keyManager != null) { underlying.setKeyManagers(new KeyManager[] { keyManager }); } - return new SSLSocketFactory(underlying); + SSLSocketFactory wrapped = new SSLSocketFactory(underlying); + if (insecure) { + wrapped.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + } + return wrapped; } /**