am 3870c570: Use hostname verifier directly instead of instance DO NOT MERGE
* commit '3870c570bbd438cefd09a061b9481314a15dd659': Use hostname verifier directly instead of instance DO NOT MERGE
This commit is contained in:
@@ -81,9 +81,6 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final HostnameVerifier HOSTNAME_VERIFIER =
|
|
||||||
HttpsURLConnection.getDefaultHostnameVerifier();
|
|
||||||
|
|
||||||
private SSLSocketFactory mInsecureFactory = null;
|
private SSLSocketFactory mInsecureFactory = null;
|
||||||
private SSLSocketFactory mSecureFactory = null;
|
private SSLSocketFactory mSecureFactory = null;
|
||||||
private TrustManager[] mTrustManagers = null;
|
private TrustManager[] mTrustManagers = null;
|
||||||
@@ -195,7 +192,7 @@ public class SSLCertificateSocketFactory extends SSLSocketFactory {
|
|||||||
if (session == null) {
|
if (session == null) {
|
||||||
throw new SSLException("Cannot verify SSL socket without session");
|
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);
|
throw new SSLPeerUnverifiedException("Cannot verify hostname: " + hostname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user