org.apache.commons.ssl
public class SSLClient extends SSLSocketFactory
Constructor and Description |
---|
SSLClient() |
getDefault
public SSLClient() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public void addTrustMaterial(TrustChain trustChain) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException, CertificateException
public void setTrustMaterial(TrustChain trustChain) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException, CertificateException
public void setKeyMaterial(KeyMaterial keyMaterial) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException, CertificateException
public void addAllowedName(String s)
public void addAllowedNames(Collection c)
public void clearAllowedNames()
public void setCheckCRL(boolean b)
public void setCheckExpiry(boolean b)
public void setCheckHostname(boolean b)
public void setConnectTimeout(int i)
public void setDefaultProtocol(String s)
public void useDefaultJavaCiphers()
public void useStrongCiphers()
public void setEnabledCiphers(String[] ciphers)
public void setEnabledProtocols(String[] protocols)
public void setHostnameVerifier(HostnameVerifier verifier)
public void setSoTimeout(int soTimeout)
public void setSSLWrapperFactory(SSLWrapperFactory wf)
public void setNeedClientAuth(boolean b)
public void setWantClientAuth(boolean b)
public void setUseClientMode(boolean b)
public List getAllowedNames()
public X509Certificate[] getAssociatedCertificateChain()
public boolean getCheckCRL()
public boolean getCheckExpiry()
public boolean getCheckHostname()
public int getConnectTimeout()
public String getDefaultProtocol()
public String[] getEnabledCiphers()
public String[] getEnabledProtocols()
public HostnameVerifier getHostnameVerifier()
public int getSoTimeout()
public SSLWrapperFactory getSSLWrapperFactory()
public boolean getNeedClientAuth()
public boolean getWantClientAuth()
public boolean getUseClientMode()
public SSLContext getSSLContext() throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public TrustChain getTrustChain()
public X509Certificate[] getCurrentServerChain()
public String[] getDefaultCipherSuites()
getDefaultCipherSuites
in class SSLSocketFactory
public String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class SSLSocketFactory
public Socket createSocket() throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(String host, int port) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(InetAddress host, int port) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(InetAddress host, int port, InetAddress localHost, int localPort) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
createSocket
in class SocketFactory
IOException
public Socket createSocket(String host, int port, InetAddress localHost, int localPort, int timeout) throws IOException
host
- the host name/IPport
- the port on the hostlocalHost
- the local host name/IP to bind the socket tolocalPort
- the port on the local machinetimeout
- the connection timeout (0==infinite)IOException
- if an I/O error occurs while creating thesocketUnknownHostException
- if the IP address of the host cannot be
determinedpublic Socket createSocket(Socket s, String remoteHost, int remotePort, boolean autoClose) throws IOException
createSocket
in class SSLSocketFactory
IOException