am 74a550fa: Merge "Change verifyServerDomainAndCertificates to pass in a hostname." into jb-mr1-dev

* commit '74a550fac7f30463c368bc01969a4fa57ac61791':
  Change verifyServerDomainAndCertificates to pass in a hostname.
This commit is contained in:
Geremy Condra
2012-09-15 16:11:18 -07:00
committed by Android Git Automerger

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) {