正在查看: Oolka v2.4.42 应用的 JuspaySSLSocketFactory.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Oolka v2.4.42 应用的 JuspaySSLSocketFactory.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.juspay.hypersdk.utils.network;
import java.net.InetAddress;
import java.net.Socket;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
public class JuspaySSLSocketFactory extends SSLSocketFactory {
private final SSLSocketFactory delegate;
public JuspaySSLSocketFactory() {
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, null, null);
this.delegate = sSLContext.getSocketFactory();
}
private Socket enableTLSOnSocket(Socket socket) {
if (socket instanceof SSLSocket) {
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.2"});
}
return socket;
}
@Override
public Socket createSocket() {
return enableTLSOnSocket(this.delegate.createSocket());
}
@Override
public String[] getDefaultCipherSuites() {
return this.delegate.getDefaultCipherSuites();
}
@Override
public String[] getSupportedCipherSuites() {
return this.delegate.getSupportedCipherSuites();
}
@Override
public Socket createSocket(Socket socket, String str, int i, boolean z) {
return enableTLSOnSocket(this.delegate.createSocket(socket, str, i, z));
}
@Override
public Socket createSocket(String str, int i) {
return enableTLSOnSocket(this.delegate.createSocket(str, i));
}
@Override
public Socket createSocket(String str, int i, InetAddress inetAddress, int i2) {
return enableTLSOnSocket(this.delegate.createSocket(str, i, inetAddress, i2));
}
@Override
public Socket createSocket(InetAddress inetAddress, int i) {
return enableTLSOnSocket(this.delegate.createSocket(inetAddress, i));
}
@Override
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) {
return enableTLSOnSocket(this.delegate.createSocket(inetAddress, i, inetAddress2, i2));
}
}