Merge "Change verifyServerDomainAndCertificates to pass in a hostname." into jb-mr1-dev

This commit is contained in:
Geremy Condra
2012-09-14 17:07:33 -07:00
committed by Android (Google) Code Review

View File

@@ -168,7 +168,13 @@ public class CertificateChainValidator {
}
try {
SSLParametersImpl.getDefaultTrustManager().checkServerTrusted(chain, authType);
X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
if (x509TrustManager instanceof TrustManagerImpl) {
TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
trustManager.checkServerTrusted(chain, authType, domain);
} else {
x509TrustManager.checkServerTrusted(chain, authType);
}
return null; // No errors.
} catch (GeneralSecurityException e) {
if (HttpLog.LOGV) {