am ca549d9c: am f5d758c0: Merge "Start handshake before calling hostname verifier, part 2" into mnc-dev

* commit 'ca549d9c2fa24bd322b4a75e720ab15928af0e57':
  Start handshake before calling hostname verifier, part 2
This commit is contained in:
Kenny Root
2015-05-13 20:31:08 +00:00
committed by Android Git Automerger

View File

@@ -397,6 +397,14 @@ public class SSLSocketFactory implements LayeredSocketFactory {
port,
autoClose
);
// BEGIN android-added
/*
* Make sure we have started the handshake before verifying.
* Otherwise when we go to the hostname verifier, it directly calls
* SSLSocket#getSession() which swallows SSL handshake errors.
*/
sslSocket.startHandshake();
// END android-added
hostnameVerifier.verify(host, sslSocket);
// verifyHostName() didn't blowup - good!
return sslSocket;