Skip to content

Commit 74a550f

Browse files
gcondraAndroid (Google) Code Review
authored andcommitted
Merge "Change verifyServerDomainAndCertificates to pass in a hostname." into jb-mr1-dev
2 parents 1c9894a + f743e54 commit 74a550f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/java/android/net/http/CertificateChainValidator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ private static SslError verifyServerDomainAndCertificates(
168168
}
169169

170170
try {
171-
SSLParametersImpl.getDefaultTrustManager().checkServerTrusted(chain, authType);
171+
X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
172+
if (x509TrustManager instanceof TrustManagerImpl) {
173+
TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
174+
trustManager.checkServerTrusted(chain, authType, domain);
175+
} else {
176+
x509TrustManager.checkServerTrusted(chain, authType);
177+
}
172178
return null; // No errors.
173179
} catch (GeneralSecurityException e) {
174180
if (HttpLog.LOGV) {

0 commit comments

Comments
 (0)