what-the-bank/sources/com/facetec/sdk/df.java

69 lines
2.5 KiB
Java

package com.facetec.sdk;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
/* loaded from: classes.dex */
final class df extends SSLSocketFactory {
private final SSLSocketFactory delegate;
public df() throws KeyManagementException, NoSuchAlgorithmException {
SSLContext sSLContext = SSLContext.getInstance(org.apache.http.conn.ssl.SSLSocketFactory.TLS);
sSLContext.init(null, null, null);
this.delegate = sSLContext.getSocketFactory();
}
@Override // javax.net.ssl.SSLSocketFactory
public final String[] getDefaultCipherSuites() {
return this.delegate.getDefaultCipherSuites();
}
@Override // javax.net.ssl.SSLSocketFactory
public final String[] getSupportedCipherSuites() {
return this.delegate.getSupportedCipherSuites();
}
@Override // javax.net.SocketFactory
public final Socket createSocket() throws IOException {
return c(this.delegate.createSocket());
}
@Override // javax.net.ssl.SSLSocketFactory
public final Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException {
return c(this.delegate.createSocket(socket, str, i, z));
}
@Override // javax.net.SocketFactory
public final Socket createSocket(String str, int i) throws IOException {
return c(this.delegate.createSocket(str, i));
}
@Override // javax.net.SocketFactory
public final Socket createSocket(String str, int i, InetAddress inetAddress, int i2) throws IOException {
return c(this.delegate.createSocket(str, i, inetAddress, i2));
}
@Override // javax.net.SocketFactory
public final Socket createSocket(InetAddress inetAddress, int i) throws IOException {
return c(this.delegate.createSocket(inetAddress, i));
}
@Override // javax.net.SocketFactory
public final Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) throws IOException {
return c(this.delegate.createSocket(inetAddress, i, inetAddress2, i2));
}
private static Socket c(Socket socket) {
if (socket != null && (socket instanceof SSLSocket)) {
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.1", "TLSv1.2"});
}
return socket;
}
}