package o; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.X509TrustManager; /* loaded from: classes2.dex */ public final class FFi extends SSLSocketFactory { private SSLContext a; private String[] b; private String[] c; private SSLSocket d = null; private String[] e; private String[] h; @Override // javax.net.SocketFactory public final Socket createSocket(String str, int i) throws IOException { Socket createSocket = this.a.getSocketFactory().createSocket(str, i); if (createSocket instanceof SSLSocket) { SSLSocket sSLSocket = (SSLSocket) createSocket; Tzr.a(sSLSocket); Tzr.e(sSLSocket); this.d = sSLSocket; this.c = (String[]) sSLSocket.getEnabledCipherSuites().clone(); } return createSocket; } @Override // javax.net.SocketFactory public final Socket createSocket(InetAddress inetAddress, int i) throws IOException { return createSocket(inetAddress.getHostAddress(), i); } @Override // javax.net.SocketFactory public final Socket createSocket(String str, int i, InetAddress inetAddress, int i2) throws IOException, UnknownHostException { return createSocket(str, i); } @Override // javax.net.SocketFactory public final Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) throws IOException { return createSocket(inetAddress.getHostAddress(), i); } @Override // javax.net.ssl.SSLSocketFactory public final Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException { Socket createSocket = this.a.getSocketFactory().createSocket(socket, str, i, z); if (createSocket instanceof SSLSocket) { SSLSocket sSLSocket = (SSLSocket) createSocket; Tzr.a(sSLSocket); Tzr.e(sSLSocket); this.d = sSLSocket; this.c = (String[]) sSLSocket.getEnabledCipherSuites().clone(); } return createSocket; } @Deprecated public FFi(X509TrustManager x509TrustManager) throws NoSuchAlgorithmException, KeyManagementException, IllegalArgumentException { this.a = null; SSLContext d = Tzr.d(); this.a = d; d.init(null, new X509TrustManager[]{x509TrustManager}, null); } @Override // javax.net.ssl.SSLSocketFactory public final String[] getSupportedCipherSuites() { String[] strArr = this.c; return strArr != null ? strArr : new String[0]; } @Override // javax.net.ssl.SSLSocketFactory public final String[] getDefaultCipherSuites() { return new String[0]; } }