public class TLSSocketFactory extends AbstractTLSSocketFactory
initialize() must be
called prior to using this socket factory. This means that this class cannot be passed to implementations that expect
the socket factory to function immediately after construction.DEFAULT_PROTOCOL, factory, logger| Constructor and Description |
|---|
TLSSocketFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addHostnameVerifyingTrustManager(SslConfig config,
java.lang.String[] names)
Adds a
HostnameVerifyingTrustManager to the supplied config if no trust managers have been configured. |
static javax.net.SocketFactory |
getDefault()
Returns the default SSL socket factory.
|
static javax.net.ssl.SSLSocketFactory |
getHostnameVerifierFactory(SslConfig config,
java.lang.String[] names)
Returns an instance of this socket factory configured with a hostname verifying trust manager.
|
void |
initialize()
Creates the underlying SSLContext using truststore and keystore attributes and makes this factory ready for use.
|
java.lang.String |
toString() |
createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, getDefaultCipherSuites, getFactory, getSocketConfig, getSslConfig, getSupportedCipherSuites, initSSLSocket, setSocketConfig, setSslConfigpublic void initialize()
throws java.security.GeneralSecurityException
initialize in class AbstractTLSSocketFactoryjava.security.GeneralSecurityException - if the SSLContext cannot be createdpublic static javax.net.SocketFactory getDefault()
public static javax.net.ssl.SSLSocketFactory getHostnameVerifierFactory(SslConfig config, java.lang.String[] names)
HostnameVerifyingTrustManager with DefaultHostnameVerifier
is set. See addHostnameVerifyingTrustManager(SslConfig, String[]).config - to set on the socket factorynames - to use for hostname verificationprotected static void addHostnameVerifyingTrustManager(SslConfig config, java.lang.String[] names)
HostnameVerifyingTrustManager to the supplied config if no trust managers have been configured. A
DefaultTrustManager is also added in no CredentialConfig has been configured.config - to modifynames - of the hosts to verifypublic java.lang.String toString()
toString in class java.lang.Object