public class TLSSocketFactoryBuilder extends Object
TLSSocketFactory which allows easy specification
of the full range of supported factory inputs.| Modifier and Type | Field and Description |
|---|---|
private static String |
DEFAULT_CONTEXT_PROTOCOL
The default protocol used when obtaining the SSLContxt instance.
|
private static X509HostnameVerifier |
DEFAULT_HOSTNAME_VERIFIER
The default hostname verifier used by the socket factory.
|
private List<String> |
enabledCipherSuites
The SSL/TLS cipher suites enabled on sockets produced the socket factory.
|
private List<String> |
enabledProtocols
The SSL/TLS protocols enabled on sockets produced by the socket factory.
|
private X509HostnameVerifier |
hostnameVerifier
The hostname verifier used by the socket factory.
|
private List<KeyManager> |
keyManagers
The list of KeyManagers used when initializing the SSLContext instance.
|
private SecureRandom |
secureRandom
The SecureRandom instance used when initializing the SSLContext instance.
|
private String |
sslContextProtocol
The protocol used when obtaining the SSLContext instance.
|
private String |
sslContextProvider
The JCA provider used when obtaining the SSLContext instance.
|
private List<TrustManager> |
trustManagers
The list of TrustManagers used when initializing the SSLContext instance.
|
| Constructor and Description |
|---|
TLSSocketFactoryBuilder() |
private static final String DEFAULT_CONTEXT_PROTOCOL
private static final X509HostnameVerifier DEFAULT_HOSTNAME_VERIFIER
private String sslContextProtocol
private String sslContextProvider
private List<KeyManager> keyManagers
private List<TrustManager> trustManagers
private SecureRandom secureRandom
private X509HostnameVerifier hostnameVerifier
private List<String> enabledProtocols
@Nullable public String getSSLContextProtocol()
SSLContext
via SSLContext.getInstance(String).
If not specified, the value "TLS" will be used.
public TLSSocketFactoryBuilder setSSLContextProtocol(@Nullable String protocol)
SSLContext
via SSLContext.getInstance(String).
If not specified, the value "TLS" will be used.
protocol - the protocol, may be null@Nullable public String getSSLContextProvider()
SSLContext
via SSLContext.getInstance(String, String).public TLSSocketFactoryBuilder setSSLContextProvider(@Nullable String provider)
SSLContext
via SSLContext.getInstance(String, String).provider - the provider name, may be null@Nullable public List<KeyManager> getKeyManagers()
KeyManagers used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).public TLSSocketFactoryBuilder setKeyManagers(@Nullable List<KeyManager> managers)
KeyManagers used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).managers - the list of key managers, or null@Nullable public List<TrustManager> getTrustManagers()
TrustManagers used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).public TLSSocketFactoryBuilder setTrustManagers(@Nullable List<TrustManager> managers)
TrustManagers used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).managers - the list of trust managers, or null@Nullable public SecureRandom getSecureRandom()
SecureRandom instance used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).public TLSSocketFactoryBuilder setSecureRandom(@Nullable SecureRandom random)
SecureRandom instance used to initialize the SSLContext
via SSLContext.init(KeyManager[], TrustManager[], SecureRandom).random - the secure random instance, or null@Nullable public X509HostnameVerifier getHostnameVerifier()
X509HostnameVerifier instance used by the socket factory.
If not specified, defaults to TLSSocketFactory.STRICT_HOSTNAME_VERIFIER.
public TLSSocketFactoryBuilder setHostnameVerifier(@Nullable X509HostnameVerifier verifier)
X509HostnameVerifier instance used by the socket factory.
If not specified, defaults to TLSSocketFactory.STRICT_HOSTNAME_VERIFIER.
verifier - the hostname verifier, or null@Nullable public List<String> getEnabledProtocols()
public TLSSocketFactoryBuilder setEnabledProtocols(@Nullable List<String> protocols)
protocols - the list of protocols, or null@Nullable public List<String> getEnabledCipherSuites()
public TLSSocketFactoryBuilder setEnabledCipherSuites(@Nullable List<String> cipherSuites)
cipherSuites - the list of cipher suites, or null@Nonnull public TLSSocketFactory build()
TLSSocketFactory, based on the properties specified
to this builder instance.@Nonnull protected SSLContext buildSSLContext()
SSLContext based on the properties specified on this builder instance.Copyright © 1999–2019 Shibboleth Consortium. All rights reserved.