diff options
-rw-r--r-- | core/java/org/apache/http/conn/ssl/SSLSocketFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java b/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java index 4d53d40..ae14149 100644 --- a/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java +++ b/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java @@ -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) { |