diff options
author | Kenny Root <kroot@google.com> | 2015-05-13 17:52:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-13 17:52:35 +0000 |
commit | 72b40431c28ad3fff177813d3bbd68e779302924 (patch) | |
tree | 55b480d27186e1f24c3f3c6c5c775a1eb60c67c9 | |
parent | aa83190cb650e9b714f2b980aa29ece8f86d587a (diff) | |
parent | 317c0a4959df0361431d5fbf7dacc162bfb48cd2 (diff) | |
download | android_external_apache-http-72b40431c28ad3fff177813d3bbd68e779302924.tar.gz android_external_apache-http-72b40431c28ad3fff177813d3bbd68e779302924.tar.bz2 android_external_apache-http-72b40431c28ad3fff177813d3bbd68e779302924.zip |
Merge "Start handshake before calling hostname verifier"
-rw-r--r-- | src/org/apache/http/conn/ssl/SSLSocketFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/apache/http/conn/ssl/SSLSocketFactory.java b/src/org/apache/http/conn/ssl/SSLSocketFactory.java index 1e46fee..0b5aa37 100644 --- a/src/org/apache/http/conn/ssl/SSLSocketFactory.java +++ b/src/org/apache/http/conn/ssl/SSLSocketFactory.java @@ -330,6 +330,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) { |