Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86666607 authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

Tracking changes to SSLParametersImpl.getDefaultTrustManager()

Change-Id: I0bcf2bbcd2581f6b66e08d1c6f0de24bf8d34199
parent ffb66ec2
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.net.http;


import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyManagementException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
@@ -128,11 +130,14 @@ public class CertificateChainValidator {
     */
    public static void handleTrustStorageUpdate() {

        try {
            X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultTrustManager();
            if( x509TrustManager instanceof TrustManagerImpl ) {
                TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
                trustManager.handleTrustStorageUpdate();
            }
        } catch (KeyManagementException ignored) {
        }
    }

    /**
@@ -165,7 +170,7 @@ public class CertificateChainValidator {
        try {
            SSLParametersImpl.getDefaultTrustManager().checkServerTrusted(chain, authType);
            return null;  // No errors.
        } catch (CertificateException e) {
        } catch (GeneralSecurityException e) {
            if (HttpLog.LOGV) {
                HttpLog.v("failed to validate the certificate chain, error: " +
                    e.getMessage());