Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84260768 authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Start handshake before calling hostname verifier" into mnc-dev

parents 59a5733a 423a47bb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -329,6 +329,14 @@ public class SSLSocketFactory implements LayeredSocketFactory {

        sslsock.setSoTimeout(soTimeout);
        try {
            // 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.
             */
            sslsock.startHandshake();
            // END android-added
            hostnameVerifier.verify(host, sslsock);
            // verifyHostName() didn't blowup - good!
        } catch (IOException iox) {