/* */ package com.skyline.electricity.utils; /* */ /* */ import java.io.IOException; /* */ import java.net.InetAddress; /* */ import java.net.Socket; /* */ import javax.net.ssl.SSLSocket; /* */ import javax.net.ssl.SSLSocketFactory; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ class MyCustomSSLSocketFactory /* */ extends SSLSocketFactory /* */ { /* */ private final SSLSocketFactory delegate; /* */ /* */ public MyCustomSSLSocketFactory(SSLSocketFactory delegate) { /* 58 */ this.delegate = delegate; /* */ } /* */ /* */ /* */ /* */ /* */ public String[] getDefaultCipherSuites() { /* 65 */ return this.delegate.getDefaultCipherSuites(); /* */ } /* */ /* */ /* */ /* */ public String[] getSupportedCipherSuites() { /* 71 */ return this.delegate.getSupportedCipherSuites(); /* */ } /* */ /* */ /* */ /* */ /* */ public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException { /* 78 */ Socket underlyingSocket = this.delegate.createSocket(socket, host, port, autoClose); /* 79 */ return overrideProtocol(underlyingSocket); /* */ } /* */ /* */ /* */ /* */ public Socket createSocket(String host, int port) throws IOException { /* 85 */ Socket underlyingSocket = this.delegate.createSocket(host, port); /* 86 */ return overrideProtocol(underlyingSocket); /* */ } /* */ /* */ /* */ /* */ /* */ public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException { /* 93 */ Socket underlyingSocket = this.delegate.createSocket(host, port, localAddress, localPort); /* 94 */ return overrideProtocol(underlyingSocket); /* */ } /* */ /* */ /* */ public Socket createSocket(InetAddress host, int port) throws IOException { /* 99 */ Socket underlyingSocket = this.delegate.createSocket(host, port); /* 100 */ return overrideProtocol(underlyingSocket); /* */ } /* */ /* */ /* */ /* */ /* */ public Socket createSocket(InetAddress host, int port, InetAddress localAddress, int localPort) throws IOException { /* 107 */ Socket underlyingSocket = this.delegate.createSocket(host, port, localAddress, localPort); /* 108 */ return overrideProtocol(underlyingSocket); /* */ } /* */ /* */ private Socket overrideProtocol(Socket socket) { /* 112 */ if (!(socket instanceof SSLSocket)) { /* 113 */ throw new RuntimeException("An instance of SSLSocket is expected"); /* */ } /* 115 */ ((SSLSocket)socket).setEnabledProtocols(new String[] { "TLSv1" }); /* 116 */ return socket; /* */ } /* */ } /* Location: D:\2023\廊坊电厂\src\BOOT-INF\classes\com.zip!\com\skyline\electricit\\utils\HttpsClientRequestFactory$MyCustomSSLSocketFactory.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */