leutu
2024-05-08 543e4eb01ca210b20876e8139cb3d0403d7d065c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*     */ 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
 */