public class HttpSecureProtocol extends SSLClient implements SecureProtocolSocketFactory
Constructor and Description |
---|
HttpSecureProtocol() |
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket(String host,
int port,
InetAddress localAddress,
int localPort,
HttpConnectionParams params)
Attempts to get a new socket connection to the given host within the
given time limit.
|
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
createSocket, getDefault
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSocket
createSocket, createSocket
public HttpSecureProtocol() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException
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
createSocket
in interface 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
determined