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

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

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

parents fb13d497 725a4a71
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;