mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 01:47:17 +01:00
61 lines
2.2 KiB
Java
61 lines
2.2 KiB
Java
package com.ReactNativeBlobUtil.Utils;
|
|
|
|
import java.io.IOException;
|
|
import java.net.InetAddress;
|
|
import java.net.Socket;
|
|
import java.net.UnknownHostException;
|
|
import javax.net.ssl.SSLSocket;
|
|
import javax.net.ssl.SSLSocketFactory;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes15.dex */
|
|
public class Tls12SocketFactory extends SSLSocketFactory {
|
|
private static final String[] TLS_V12_ONLY = {"TLSv1.2"};
|
|
final SSLSocketFactory delegate;
|
|
|
|
public Tls12SocketFactory(SSLSocketFactory sSLSocketFactory) {
|
|
this.delegate = sSLSocketFactory;
|
|
}
|
|
|
|
private Socket patch(Socket socket) {
|
|
if (socket instanceof SSLSocket) {
|
|
((SSLSocket) socket).setEnabledProtocols(TLS_V12_ONLY);
|
|
}
|
|
return socket;
|
|
}
|
|
|
|
@Override // javax.net.ssl.SSLSocketFactory
|
|
public Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException {
|
|
return patch(this.delegate.createSocket(socket, str, i, z));
|
|
}
|
|
|
|
@Override // javax.net.ssl.SSLSocketFactory
|
|
public String[] getDefaultCipherSuites() {
|
|
return this.delegate.getDefaultCipherSuites();
|
|
}
|
|
|
|
@Override // javax.net.ssl.SSLSocketFactory
|
|
public String[] getSupportedCipherSuites() {
|
|
return this.delegate.getSupportedCipherSuites();
|
|
}
|
|
|
|
@Override // javax.net.SocketFactory
|
|
public Socket createSocket(String str, int i) throws IOException, UnknownHostException {
|
|
return patch(this.delegate.createSocket(str, i));
|
|
}
|
|
|
|
@Override // javax.net.SocketFactory
|
|
public Socket createSocket(String str, int i, InetAddress inetAddress, int i2) throws IOException, UnknownHostException {
|
|
return patch(this.delegate.createSocket(str, i, inetAddress, i2));
|
|
}
|
|
|
|
@Override // javax.net.SocketFactory
|
|
public Socket createSocket(InetAddress inetAddress, int i) throws IOException {
|
|
return patch(this.delegate.createSocket(inetAddress, i));
|
|
}
|
|
|
|
@Override // javax.net.SocketFactory
|
|
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) throws IOException {
|
|
return patch(this.delegate.createSocket(inetAddress, i, inetAddress2, i2));
|
|
}
|
|
}
|