package 㿎;

import java.io.IOException;
import java.security.cert.Certificate;
import java.util.Collections;
import java.util.List;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import okhttp3.TlsVersion;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.ݜ  reason: contains not printable characters */
/* compiled from: Handshake */
public final class C2536 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final List<Certificate> f8553;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C2665 f8554;

    /* renamed from: K  reason: contains not printable characters */
    public final TlsVersion f8555;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final List<Certificate> f8556;

    public C2536(TlsVersion tlsVersion, C2665 r2, List<Certificate> list, List<Certificate> list2) {
        this.f8555 = tlsVersion;
        this.f8554 = r2;
        this.f8553 = list;
        this.f8556 = list2;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2536 m6627(SSLSession sSLSession) throws IOException {
        Certificate[] certificateArr;
        List list;
        List list2;
        String cipherSuite = sSLSession.getCipherSuite();
        if (cipherSuite == null) {
            throw new IllegalStateException("cipherSuite == null");
        } else if (!"SSL_NULL_WITH_NULL_NULL".equals(cipherSuite)) {
            C2665 r0 = C2665.m6991(cipherSuite);
            String protocol = sSLSession.getProtocol();
            if (protocol == null) {
                throw new IllegalStateException("tlsVersion == null");
            } else if (!"NONE".equals(protocol)) {
                TlsVersion forJavaName = TlsVersion.forJavaName(protocol);
                try {
                    certificateArr = sSLSession.getPeerCertificates();
                } catch (SSLPeerUnverifiedException unused) {
                    certificateArr = null;
                }
                if (certificateArr != null) {
                    list = C2540.m6647(certificateArr);
                } else {
                    list = Collections.emptyList();
                }
                Certificate[] localCertificates = sSLSession.getLocalCertificates();
                if (localCertificates != null) {
                    list2 = C2540.m6647(localCertificates);
                } else {
                    list2 = Collections.emptyList();
                }
                return new C2536(forJavaName, r0, list, list2);
            } else {
                throw new IOException("tlsVersion == NONE");
            }
        } else {
            throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL");
        }
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof C2536)) {
            return false;
        }
        C2536 r4 = (C2536) obj;
        if (!this.f8555.equals(r4.f8555) || !this.f8554.equals(r4.f8554) || !this.f8553.equals(r4.f8553) || !this.f8556.equals(r4.f8556)) {
            return false;
        }
        return true;
    }

    public int hashCode() {
        int hashCode = this.f8554.hashCode();
        int hashCode2 = this.f8553.hashCode();
        return this.f8556.hashCode() + ((hashCode2 + ((hashCode + ((this.f8555.hashCode() + 527) * 31)) * 31)) * 31);
    }
}
