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,
String[] names)
Deprecated.
HostnameVerifierConfig should be used for hostname verification |
protected SSLContextInitializer |
createSSLContextInitializer()
Creates a
SSLContextInitializer for use with this socket factory. |
static SocketFactory |
getDefault()
Returns the default SSL socket factory.
|
static SSLSocketFactory |
getHostnameVerifierFactory(SslConfig config,
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.
|
String |
toString() |
createSocket, createSocket, createSocket, createSocket, createSocket, createSocket, getDefaultCipherSuites, getFactory, getSocketConfig, getSslConfig, getSupportedCipherSuites, initSSLSocket, setSocketConfig, setSslConfig
createSocket
public void initialize() throws GeneralSecurityException
initialize
in class AbstractTLSSocketFactory
GeneralSecurityException
- if the SSLContext cannot be createdprotected SSLContextInitializer createSSLContextInitializer() throws GeneralSecurityException
SSLContextInitializer
for use with this socket factory.GeneralSecurityException
- if the SSL context initializer cannot be createdpublic static SocketFactory getDefault()
public static SSLSocketFactory getHostnameVerifierFactory(SslConfig config, String[] names)
HostnameVerifyingTrustManager
with DefaultHostnameVerifier
is set. See addHostnameVerifyingTrustManager(SslConfig, String[])
.config
- to set on the socket factorynames
- to use for hostname verification@Deprecated protected static void addHostnameVerifyingTrustManager(SslConfig config, String[] names)
HostnameVerifierConfig
should be used for hostname verificationHostnameVerifyingTrustManager
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 verifyCopyright © 2003-2019 Virginia Tech. All Rights Reserved.