package 㿎.ሽ.ᨨ;

import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.util.List;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import okhttp3.Protocol;
import org.conscrypt.Conscrypt;
import org.conscrypt.OpenSSLProvider;

/* renamed from: 㿎.ሽ.ᨨ.ῲ  reason: contains not printable characters */
/* compiled from: ConscryptPlatform */
public class C2553 extends C2558 {
    /* renamed from: ʬ  reason: contains not printable characters */
    public static C2558 m6699() {
        try {
            Class.forName("org.conscrypt.ConscryptEngineSocket");
            if (!Conscrypt.isAvailable()) {
                return null;
            }
            return new C2553();
        } catch (ClassNotFoundException unused) {
            return null;
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Provider m6701() {
        return new OpenSSLProvider();
    }

    @Override // 㿎.ሽ.ᨨ.C2558
    /* renamed from: K  reason: contains not printable characters */
    public void m6704(SSLSocket sSLSocket, String str, List<Protocol> list) {
        if (Conscrypt.isConscrypt(sSLSocket)) {
            if (str != null) {
                Conscrypt.setUseSessionTickets(sSLSocket, true);
                Conscrypt.setHostname(sSLSocket, str);
            }
            Conscrypt.setApplicationProtocols(sSLSocket, (String[]) C2558.m6723(list).toArray(new String[0]));
            return;
        }
        super.m6735(sSLSocket, str, list);
    }

    @Override // 㿎.ሽ.ᨨ.C2558
    /* renamed from: ῲ  reason: contains not printable characters */
    public X509TrustManager m6702(SSLSocketFactory sSLSocketFactory) {
        if (!Conscrypt.isConscrypt(sSLSocketFactory)) {
            return super.m6725(sSLSocketFactory);
        }
        try {
            Object r3 = C2558.m6722(sSLSocketFactory, Object.class, "sslParameters");
            if (r3 != null) {
                return (X509TrustManager) C2558.m6722(r3, X509TrustManager.class, "x509TrustManager");
            }
            return null;
        } catch (Exception e) {
            throw new UnsupportedOperationException("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on Conscrypt", e);
        }
    }

    @Override // 㿎.ሽ.ᨨ.C2558
    /* renamed from: K  reason: contains not printable characters */
    public SSLContext m6703() {
        try {
            return SSLContext.getInstance("TLS", m6701());
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalStateException("No TLS provider", e);
        }
    }

    @Override // 㿎.ሽ.ᨨ.C2558
    /* renamed from: ῲ  reason: contains not printable characters */
    public String m6700(SSLSocket sSLSocket) {
        if (Conscrypt.isConscrypt(sSLSocket)) {
            return Conscrypt.getApplicationProtocol(sSLSocket);
        }
        super.m6724(sSLSocket);
        return null;
    }

    @Override // 㿎.ሽ.ᨨ.C2558
    /* renamed from: K  reason: contains not printable characters */
    public void m6705(SSLSocketFactory sSLSocketFactory) {
        if (Conscrypt.isConscrypt(sSLSocketFactory)) {
            Conscrypt.setUseEngineSocket(sSLSocketFactory, true);
        }
    }
}
