DO NOT MERGE: Fix hostname verifier for Exchange connections.

When the socketfactory init code was moved, I forgot to re-add in the check
to skip hostname verification. This made "Trust all SSL certificates"
checkbox useless.

Backported from: Ie4cba749aaf8c0fd9f9c43f09ebf354c6600d4f0
Bug: 5450563

Change-Id: Id1c80393d41068e6872ca5d42a3e5888805a3f09
This commit is contained in:
Ben Komalo 2011-10-12 13:41:59 -07:00 committed by Marc Blank
parent ee48894dfd
commit 7e65b1fc1d

View File

@ -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;
}
/**