public class SslConfiguration extends java.lang.Object implements Toggleable
Modifier and Type | Class and Description |
---|---|
static class |
SslConfiguration.KeyConfiguration
Configuration properties for SSL key.
|
static class |
SslConfiguration.KeyStoreConfiguration
Configuration properties for SSL key store.
|
static class |
SslConfiguration.TrustStoreConfiguration
Configuration properties for SSL trust store.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_BUILDSELFSIGNED
The default build self signed value.
|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static int |
DEFAULT_PORT
The default port value.
|
static java.lang.String |
DEFAULT_PROTOCOL
The default protocol.
|
static java.lang.String |
PREFIX
The prefix used to resolve this configuration.
|
Constructor and Description |
---|
SslConfiguration() |
Modifier and Type | Method and Description |
---|---|
boolean |
buildSelfSigned() |
java.util.Optional<java.lang.String[]> |
getCiphers() |
java.util.Optional<ClientAuthentication> |
getClientAuthentication() |
SslConfiguration.KeyConfiguration |
getKey() |
SslConfiguration.KeyStoreConfiguration |
getKeyStore() |
int |
getPort() |
java.util.Optional<java.lang.String> |
getProtocol() |
java.util.Optional<java.lang.String[]> |
getProtocols() |
SslConfiguration.TrustStoreConfiguration |
getTrustStore() |
boolean |
isEnabled() |
protected void |
readExisting(SslConfiguration defaultSslConfiguration,
SslConfiguration.KeyConfiguration defaultKeyConfiguration,
SslConfiguration.KeyStoreConfiguration defaultKeyStoreConfiguration,
SslConfiguration.TrustStoreConfiguration defaultTrustStoreConfiguration)
Reads an existing config.
|
void |
setBuildSelfSigned(boolean buildSelfSigned)
Sets whether to build a self signed certificate.
|
void |
setCiphers(java.lang.String[] ciphers)
Sets the ciphers to use.
|
void |
setClientAuthentication(ClientAuthentication clientAuthentication)
Sets the client authentication mode.
|
void |
setEnabled(boolean enabled)
Whether SSL is enabled.
|
void |
setKey(SslConfiguration.KeyConfiguration key)
Sets the key configuration.
|
void |
setKeyStore(SslConfiguration.KeyStoreConfiguration keyStore)
Sets the keystore configuration.
|
void |
setPort(int port)
Sets the SSL port.
|
void |
setProtocol(java.lang.String protocol)
Sets the protocol to use.
|
void |
setProtocols(java.lang.String[] protocols)
Sets the protocols to use.
|
void |
setTrustStore(SslConfiguration.TrustStoreConfiguration trustStore)
Sets the trust store configuration.
|
public static final java.lang.String PREFIX
public static final boolean DEFAULT_ENABLED
public static final int DEFAULT_PORT
public static final boolean DEFAULT_BUILDSELFSIGNED
public static final java.lang.String DEFAULT_PROTOCOL
public boolean isEnabled()
isEnabled
in interface Toggleable
public void setEnabled(boolean enabled)
enabled
- True if SSL is enabledpublic int getPort()
public boolean buildSelfSigned()
public java.util.Optional<ClientAuthentication> getClientAuthentication()
public java.util.Optional<java.lang.String[]> getCiphers()
public java.util.Optional<java.lang.String[]> getProtocols()
public SslConfiguration.KeyConfiguration getKey()
public SslConfiguration.KeyStoreConfiguration getKeyStore()
public SslConfiguration.TrustStoreConfiguration getTrustStore()
public java.util.Optional<java.lang.String> getProtocol()
public void setPort(int port)
port
- The portpublic void setBuildSelfSigned(boolean buildSelfSigned)
buildSelfSigned
- True if a certificate should be builtpublic void setKey(SslConfiguration.KeyConfiguration key)
key
- The key configurationpublic void setKeyStore(SslConfiguration.KeyStoreConfiguration keyStore)
keyStore
- The keystore configurationpublic void setTrustStore(SslConfiguration.TrustStoreConfiguration trustStore)
trustStore
- The trust store.public void setClientAuthentication(ClientAuthentication clientAuthentication)
clientAuthentication
- The client authentication modepublic void setCiphers(java.lang.String[] ciphers)
ciphers
- The cipherspublic void setProtocols(java.lang.String[] protocols)
protocols
- The protocolspublic void setProtocol(java.lang.String protocol)
protocol
- The protocolprotected final void readExisting(SslConfiguration defaultSslConfiguration, SslConfiguration.KeyConfiguration defaultKeyConfiguration, SslConfiguration.KeyStoreConfiguration defaultKeyStoreConfiguration, SslConfiguration.TrustStoreConfiguration defaultTrustStoreConfiguration)
defaultSslConfiguration
- The default SSL configdefaultKeyConfiguration
- The default key configdefaultKeyStoreConfiguration
- The default keystore configdefaultTrustStoreConfiguration
- The Default truststore config