package T4;

import android.net.http.X509TrustManagerExtensions;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.X509TrustManager;
import r4.AbstractC0983h;
import y1.AbstractC1111a;

/* JADX INFO: loaded from: classes.dex */
public final class b extends AbstractC1111a {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final X509TrustManager f2867c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final X509TrustManagerExtensions f2868d;

    public b(X509TrustManager x509TrustManager, X509TrustManagerExtensions x509TrustManagerExtensions) {
        this.f2867c = x509TrustManager;
        this.f2868d = x509TrustManagerExtensions;
    }

    @Override // y1.AbstractC1111a
    public final List a(String str, List list) throws SSLPeerUnverifiedException {
        AbstractC0983h.e("chain", list);
        AbstractC0983h.e("hostname", str);
        Object[] array = list.toArray(new X509Certificate[0]);
        if (array == null) {
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
        }
        try {
            List<X509Certificate> listCheckServerTrusted = this.f2868d.checkServerTrusted((X509Certificate[]) array, "RSA", str);
            AbstractC0983h.d("x509TrustManagerExtensio…ficates, \"RSA\", hostname)", listCheckServerTrusted);
            return listCheckServerTrusted;
        } catch (CertificateException e2) {
            SSLPeerUnverifiedException sSLPeerUnverifiedException = new SSLPeerUnverifiedException(e2.getMessage());
            sSLPeerUnverifiedException.initCause(e2);
            throw sSLPeerUnverifiedException;
        }
    }

    public final boolean equals(Object obj) {
        return (obj instanceof b) && ((b) obj).f2867c == this.f2867c;
    }

    public final int hashCode() {
        return System.identityHashCode(this.f2867c);
    }
}
