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)
Adds a
HostnameVerifyingTrustManager to the supplied config if no trust managers have been configured. |
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, setSslConfigcreateSocketpublic void initialize()
throws GeneralSecurityException
initialize in class AbstractTLSSocketFactoryGeneralSecurityException - if the SSLContext 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 verificationprotected static void addHostnameVerifyingTrustManager(SslConfig config, 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 verifyCopyright © 2023. All rights reserved.