diff options
author | Kenny Root <kroot@google.com> | 2013-07-23 20:36:03 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-08-13 11:00:10 -0700 |
commit | 3870c570bbd438cefd09a061b9481314a15dd659 (patch) | |
tree | 2866c2fdb6fa30bb027290a7ed53cff2ff011958 /core/java | |
parent | b478b10f34a9fa9c6b42f54047eb9e77111a16c7 (diff) | |
download | frameworks_base-3870c570bbd438cefd09a061b9481314a15dd659.zip frameworks_base-3870c570bbd438cefd09a061b9481314a15dd659.tar.gz frameworks_base-3870c570bbd438cefd09a061b9481314a15dd659.tar.bz2 |
Use hostname verifier directly instead of instance DO NOT MERGE
Instead of local instance of the default HostnameVerifier, use it
directly from HttpsURLConnection. This avoids class preloading creating
an instance of it before it's necessary.
(cherry picked from commit 928ee1e48fa89302d02fdf8a8a2c7315d7195e7c)
Bug: 9984058
Change-Id: I79d8a934bfc390e4cd503fd592e21bc4e5446a7d
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/net/SSLCertificateSocketFactory.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java index 2a2f7cf..0fe5cc4 100644 --- a/core/java/android/net/SSLCertificateSocketFactory.java +++ b/core/java/android/net/SSLCertificateSocketFactory.java @@ -81,9 +81,6 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { } }; - private static final HostnameVerifier HOSTNAME_VERIFIER = - HttpsURLConnection.getDefaultHostnameVerifier(); - private SSLSocketFactory mInsecureFactory = null; private SSLSocketFactory mSecureFactory = null; private TrustManager[] mTrustManagers = null; @@ -195,7 +192,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory { if (session == null) { throw new SSLException("Cannot verify SSL socket without session"); } - if (!HOSTNAME_VERIFIER.verify(hostname, session)) { + if (!HttpsURLConnection.getDefaultHostnameVerifier().verify(hostname, session)) { throw new SSLPeerUnverifiedException("Cannot verify hostname: " + hostname); } } |