public class SSLConnector extends Object implements org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
Modifier and Type | Field and Description |
---|---|
static String |
SECURITY_PROTOCOL_SSL_V2_HELLO |
static String |
SECURITY_PROTOCOL_SSL_V3 |
static String |
SECURITY_PROTOCOL_TLS_V1 |
static String |
SECURITY_PROTOCOL_TLS_V1_1 |
static String |
SECURITY_PROTOCOL_TLS_V1_2 |
static String |
SECURITY_PROTOCOL_TLS_V1_3 |
Constructor and Description |
---|
SSLConnector() |
SSLConnector(boolean relaxedTrust) |
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket(Socket socket,
String host,
int port,
boolean autoClose) |
Socket |
createSocket(Socket socket,
String host,
int port,
boolean autoClose,
org.apache.commons.httpclient.params.HttpConnectionParams params) |
Socket |
createSocket(String host,
int port)
Deprecated.
(2.3.0) No longer supported since it's no longer required/called by Commons
HttpClient library (version ≥ 3.0). Throws
UnsupportedOperationException . |
Socket |
createSocket(String host,
int port,
InetAddress clientHost,
int clientPort)
Deprecated.
(2.3.0) No longer supported since it's no longer required/called by Commons
HttpClient library (version ≥ 3.0). Throws
UnsupportedOperationException . |
Socket |
createSocket(String host,
int port,
InetAddress localAddress,
int localPort,
org.apache.commons.httpclient.params.HttpConnectionParams params)
Attempts to get a new socket connection to the given host within the given time limit.
|
Socket |
createTunnelServerSocket(String targethost,
Socket socket)
Create a SSLsocket using an existing connected socket.
|
static String[] |
getClientEnabledProtocols() |
SSLSocketFactory |
getClientSocketFactory(String type) |
static String[] |
getFailSafeProtocols()
Gets the SSL/TLS versions that can be safely used (known to be supported by the JRE).
|
static String[] |
getServerEnabledProtocols() |
ch.csnc.extension.httpclient.SSLContextManager |
getSSLContextManager() |
static String[] |
getSupportedProtocols() |
SSLSocketFactory |
getTunnelSSLSocketFactory(String hostname)
Deprecated.
(2.8.0) No longer used/needed.
|
SSLSocketFactory |
getTunnelSSLSocketFactory(String hostname,
InetAddress listeningAddress) |
ServerSocket |
listen(int paramPortNum,
int maxConnection,
InetAddress ip) |
void |
setActiveCertificate() |
static void |
setClientEnabledProtocols(String[] protocols) |
void |
setEnableClientCert(boolean enabled) |
static void |
setServerEnabledProtocols(String[] protocols) |
public static final String SECURITY_PROTOCOL_SSL_V2_HELLO
public static final String SECURITY_PROTOCOL_SSL_V3
public static final String SECURITY_PROTOCOL_TLS_V1
public static final String SECURITY_PROTOCOL_TLS_V1_1
public static final String SECURITY_PROTOCOL_TLS_V1_2
public static final String SECURITY_PROTOCOL_TLS_V1_3
public SSLConnector()
public SSLConnector(boolean relaxedTrust)
public ch.csnc.extension.httpclient.SSLContextManager getSSLContextManager()
public void setEnableClientCert(boolean enabled)
public void setActiveCertificate()
public ServerSocket listen(int paramPortNum, int maxConnection, InetAddress ip) throws IOException
IOException
public SSLSocketFactory getClientSocketFactory(String type)
@Deprecated public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort) throws IOException, UnknownHostException
UnsupportedOperationException
.createSocket
in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
IOException
UnknownHostException
public static String[] getFailSafeProtocols()
public static String[] getSupportedProtocols()
public static String[] getClientEnabledProtocols()
public static void setClientEnabledProtocols(String[] protocols)
public static String[] getServerEnabledProtocols()
public static void setServerEnabledProtocols(String[] protocols)
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, org.apache.commons.httpclient.params.HttpConnectionParams params) throws IOException, UnknownHostException, org.apache.commons.httpclient.ConnectTimeoutException
createSocket
in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
host
- the host name/IPport
- the port on the hostlocalAddress
- the local host name/IP to bind the socket tolocalPort
- the port on the local machineparams
- Http connection parameters
IOException
- if an I/O error occurs while creating the socketUnknownHostException
- if the IP address of the host cannot be determinedorg.apache.commons.httpclient.ConnectTimeoutException
@Deprecated public Socket createSocket(String host, int port) throws IOException, UnknownHostException
UnsupportedOperationException
.createSocket
in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
IOException
UnknownHostException
public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException
createSocket
in interface org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
IOException
UnknownHostException
SecureProtocolSocketFactory.createSocket(java.net.Socket,java.lang.String,int,boolean)
public Socket createSocket(Socket socket, String host, int port, boolean autoClose, org.apache.commons.httpclient.params.HttpConnectionParams params) throws IOException
createSocket
in interface org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
IOException
public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException
targethost
- the host where you want to connect tosocket
- IOException
@Deprecated public SSLSocketFactory getTunnelSSLSocketFactory(String hostname)
public SSLSocketFactory getTunnelSSLSocketFactory(String hostname, InetAddress listeningAddress)