org.apache.commons.ssl
Class HttpSecureProtocol
java.lang.Object
javax.net.SocketFactory
javax.net.ssl.SSLSocketFactory
org.apache.commons.ssl.SSLClient
org.apache.commons.ssl.HttpSecureProtocol
- All Implemented Interfaces:
- org.apache.commons.httpclient.protocol.ProtocolSocketFactory, org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
- Direct Known Subclasses:
- AuthSSLProtocolSocketFactory, EasySSLProtocolSocketFactory, StrictSSLProtocolSocketFactory, TrustSSLProtocolSocketFactory
public class HttpSecureProtocol
- extends SSLClient
- implements org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
Hook into HttpClient.
- Since:
- 5-May-2006
- Author:
- Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com
Method Summary |
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. |
Methods inherited from class org.apache.commons.ssl.SSLClient |
addTrustMaterial, createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, getAssociatedCertificateChain, getCheckCRL, getCheckExpiry, getCheckHostname, getConnectTimeout, getCurrentServerChain, getDefaultCipherSuites, getDefaultProtocol, getEnabledCiphers, getEnabledProtocols, getHostnameVerifier, getNeedClientAuth, getSoTimeout, getSSLContext, getSSLWrapperFactory, getSupportedCipherSuites, getTrustChain, getUseClientMode, getWantClientAuth, isSecure, setCheckCRL, setCheckExpiry, setCheckHostname, setConnectTimeout, setDefaultProtocol, setDnsOverride, setEnabledCiphers, setEnabledProtocols, setHostnameVerifier, setIsSecure, setKeyMaterial, setNeedClientAuth, setSoTimeout, setSSLWrapperFactory, setTrustMaterial, setUseClientMode, setWantClientAuth, useDefaultJavaCiphers, useStrongCiphers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory |
createSocket |
Methods inherited from interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory |
createSocket, createSocket |
HttpSecureProtocol
public HttpSecureProtocol()
throws GeneralSecurityException,
IOException
- Throws:
GeneralSecurityException
IOException
createSocket
public Socket createSocket(String host,
int port,
InetAddress localAddress,
int localPort,
org.apache.commons.httpclient.params.HttpConnectionParams params)
throws IOException
- Attempts to get a new socket connection to the given host within the
given time limit.
To circumvent the limitations of older JREs that do not support connect
timeout a controller thread is executed. The controller thread attempts
to create a new socket within the given limit of time. If socket
constructor does not return until the timeout expires, the controller
terminates and throws an
ConnectTimeoutException
- Specified by:
createSocket
in interface org.apache.commons.httpclient.protocol.ProtocolSocketFactory
- Parameters:
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
- Returns:
- Socket a new socket
- Throws:
IOException
- if an I/O error occurs while creating the socket
UnknownHostException
- if the IP address of the host cannot be
determined