|
19 | 19 |
|
20 | 20 | package org.apache.commons.httpclient.contrib.ssl; |
21 | 21 |
|
| 22 | +import org.apache.commons.httpclient.ConnectTimeoutException; |
| 23 | +import org.apache.commons.httpclient.HttpClientError; |
| 24 | +import org.apache.commons.httpclient.params.HttpConnectionParams; |
| 25 | +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; |
| 26 | +import org.apache.commons.logging.Log; |
| 27 | +import org.apache.commons.logging.LogFactory; |
| 28 | + |
| 29 | +import javax.net.SocketFactory; |
| 30 | +import javax.net.ssl.SSLContext; |
| 31 | +import javax.net.ssl.TrustManager; |
22 | 32 | import java.io.IOException; |
23 | 33 | import java.net.InetAddress; |
24 | 34 | import java.net.InetSocketAddress; |
25 | 35 | import java.net.Socket; |
26 | 36 | import java.net.SocketAddress; |
27 | 37 | import java.net.UnknownHostException; |
28 | 38 |
|
29 | | -import javax.net.SocketFactory; |
30 | | -import javax.net.ssl.SSLContext; |
31 | | -import javax.net.ssl.TrustManager; |
32 | | - |
33 | | -import org.apache.commons.httpclient.ConnectTimeoutException; |
34 | | -import org.apache.commons.httpclient.HttpClientError; |
35 | | -import org.apache.commons.httpclient.params.HttpConnectionParams; |
36 | | -import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; |
37 | | -import org.apache.commons.logging.Log; |
38 | | -import org.apache.commons.logging.LogFactory; |
39 | | - |
40 | 39 | /** |
41 | 40 | * <p> |
42 | | - * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s |
| 41 | + * EasySSLProtocolSocketFactory can be used to create SSL {@link Socket}s |
43 | 42 | * that accept self-signed certificates. |
44 | 43 | * </p> |
45 | 44 | * <p> |
|
84 | 83 | * </p> |
85 | 84 | */ |
86 | 85 |
|
87 | | -public class EasySSLProtocolSocketFactory implements SecureProtocolSocketFactory { |
| 86 | +public class EasySSLProtocolSocketFactory implements ProtocolSocketFactory { |
88 | 87 |
|
89 | 88 | /** Log object for this class. */ |
90 | 89 | private static final Log LOG = LogFactory.getLog(EasySSLProtocolSocketFactory.class); |
@@ -117,7 +116,7 @@ private SSLContext getSSLContext() { |
117 | 116 | } |
118 | 117 |
|
119 | 118 | /** |
120 | | - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) |
| 119 | + * @see ProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int) |
121 | 120 | */ |
122 | 121 | @Override |
123 | 122 | public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException { |
@@ -167,17 +166,13 @@ public Socket createSocket(final String host, final int port, final InetAddress |
167 | 166 | } |
168 | 167 |
|
169 | 168 | /** |
170 | | - * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int) |
| 169 | + * @see ProtocolSocketFactory#createSocket(java.lang.String,int) |
171 | 170 | */ |
172 | 171 | @Override |
173 | 172 | public Socket createSocket(String host, int port) throws IOException, UnknownHostException { |
174 | 173 | return getSSLContext().getSocketFactory().createSocket(host, port); |
175 | 174 | } |
176 | 175 |
|
177 | | - /** |
178 | | - * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean) |
179 | | - */ |
180 | | - @Override |
181 | 176 | public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException { |
182 | 177 | return getSSLContext().getSocketFactory().createSocket(socket, host, port, autoClose); |
183 | 178 | } |
|
0 commit comments