public class SslConfig extends AbstractConfig
Modifier and Type | Field and Description |
---|---|
private CredentialConfig |
credentialConfig
Configuration for the trust and authentication material to use for SSL and startTLS.
|
private String[] |
enabledCipherSuites
Enabled cipher suites.
|
private String[] |
enabledProtocols
Enabled protocol versions.
|
private HandshakeCompletedListener[] |
handshakeCompletedListeners
Handshake completed listeners.
|
private CertificateHostnameVerifier |
hostnameVerifier
Certificate hostname verifier.
|
private HostnameVerifierConfig |
hostnameVerifierConfig
Hostname verifier config.
|
private TrustManager[] |
trustManagers
Trust managers.
|
logger
Constructor and Description |
---|
SslConfig()
Default constructor.
|
SslConfig(CredentialConfig config)
Creates a new ssl config.
|
SslConfig(CredentialConfig config,
TrustManager... managers)
Creates a new ssl config.
|
SslConfig(TrustManager... managers)
Creates a new ssl config.
|
Modifier and Type | Method and Description |
---|---|
CredentialConfig |
getCredentialConfig()
Returns the credential config.
|
String[] |
getEnabledCipherSuites()
Returns the names of the SSL cipher suites to use for secure connections.
|
String[] |
getEnabledProtocols()
Returns the names of the SSL protocols to use for secure connections.
|
HandshakeCompletedListener[] |
getHandshakeCompletedListeners()
Returns the handshake completed listeners to use for secure connections.
|
CertificateHostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier.
|
protected HostnameVerifierConfig |
getHostnameVerifierConfig()
Returns the hostname verifier config.
|
TrustManager[] |
getTrustManagers()
Returns the trust managers.
|
boolean |
isEmpty()
Returns whether this ssl config contains any configuration data.
|
static SslConfig |
newSslConfig(SslConfig config)
Returns a ssl config initialized with the supplied config.
|
void |
setCredentialConfig(CredentialConfig config)
Sets the credential config.
|
void |
setEnabledCipherSuites(String... suites)
Sets the SSL cipher suites to use for secure connections.
|
void |
setEnabledProtocols(String... protocols)
Sets the SSL protocol versions to use for secure connections.
|
void |
setHandshakeCompletedListeners(HandshakeCompletedListener... listeners)
Sets the handshake completed listeners to use for secure connections.
|
void |
setHostnameVerifier(CertificateHostnameVerifier verifier)
Sets the hostname verifier.
|
protected void |
setHostnameVerifierConfig(HostnameVerifierConfig config)
Sets the hostname verifier config.
|
void |
setTrustManagers(TrustManager... managers)
Sets the trust managers.
|
String |
toString() |
checkImmutable, checkStringInput, makeImmutable
private CredentialConfig credentialConfig
private TrustManager[] trustManagers
private CertificateHostnameVerifier hostnameVerifier
private HostnameVerifierConfig hostnameVerifierConfig
private String[] enabledCipherSuites
private String[] enabledProtocols
private HandshakeCompletedListener[] handshakeCompletedListeners
public SslConfig()
public SslConfig(CredentialConfig config)
config
- credential configpublic SslConfig(TrustManager... managers)
managers
- trust managerspublic SslConfig(CredentialConfig config, TrustManager... managers)
config
- credential configmanagers
- trust managerspublic boolean isEmpty()
public CredentialConfig getCredentialConfig()
public void setCredentialConfig(CredentialConfig config)
config
- credential configpublic TrustManager[] getTrustManagers()
public void setTrustManagers(TrustManager... managers)
managers
- trust managerspublic CertificateHostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(CertificateHostnameVerifier verifier)
verifier
- hostname verifierprotected HostnameVerifierConfig getHostnameVerifierConfig()
protected void setHostnameVerifierConfig(HostnameVerifierConfig config)
config
- hostname verifier configpublic String[] getEnabledCipherSuites()
public void setEnabledCipherSuites(String... suites)
suites
- cipher suitespublic String[] getEnabledProtocols()
public void setEnabledProtocols(String... protocols)
protocols
- enabled protocolspublic HandshakeCompletedListener[] getHandshakeCompletedListeners()
public void setHandshakeCompletedListeners(HandshakeCompletedListener... listeners)
listeners
- for SSL handshake eventspublic static SslConfig newSslConfig(SslConfig config)
config
- ssl config to read properties fromCopyright © 2003-2019 Virginia Tech. All Rights Reserved.