public class SslConfiguration extends 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 |
|---|---|
protected boolean |
buildSelfSigned |
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 String |
DEFAULT_PROTOCOL
The default protocol.
|
protected int |
port |
static String |
PREFIX
The prefix used to resolve this configuration.
|
| Constructor and Description |
|---|
SslConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
buildSelfSigned() |
Optional<String[]> |
getCiphers() |
Optional<ClientAuthentication> |
getClientAuthentication() |
Duration |
getHandshakeTimeout() |
SslConfiguration.KeyConfiguration |
getKey() |
SslConfiguration.KeyStoreConfiguration |
getKeyStore() |
int |
getPort() |
Optional<String> |
getProtocol() |
Optional<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)
Deprecated.
Please use
micronaut.server.ssl.build-self-signed instead (buildSelfSigned()). |
void |
setCiphers(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 |
setHandshakeTimeout(Duration handshakeTimeout) |
void |
setKey(SslConfiguration.KeyConfiguration key)
Sets the key configuration.
|
void |
setKeyStore(SslConfiguration.KeyStoreConfiguration keyStore)
Sets the keystore configuration.
|
void |
setPort(int port)
Deprecated.
Please use
micronaut.server.ssl.port instead (ServerSslConfiguration.setPort(int)). |
void |
setProtocol(String protocol)
Sets the protocol to use.
|
void |
setProtocols(String[] protocols)
Sets the protocols to use.
|
void |
setTrustStore(SslConfiguration.TrustStoreConfiguration trustStore)
Sets the trust store configuration.
|
public static final String PREFIX
public static final boolean DEFAULT_ENABLED
public static final int DEFAULT_PORT
public static final boolean DEFAULT_BUILDSELFSIGNED
public static final String DEFAULT_PROTOCOL
protected int port
protected boolean buildSelfSigned
public boolean isEnabled()
isEnabled in interface Toggleablepublic void setEnabled(boolean enabled)
enabled - True if SSL is enabledpublic int getPort()
public boolean buildSelfSigned()
public Optional<ClientAuthentication> getClientAuthentication()
public SslConfiguration.KeyConfiguration getKey()
public SslConfiguration.KeyStoreConfiguration getKeyStore()
public SslConfiguration.TrustStoreConfiguration getTrustStore()
@NonNull public Duration getHandshakeTimeout()
@Deprecated public void setPort(int port)
micronaut.server.ssl.port instead (ServerSslConfiguration.setPort(int)).port - The port@Deprecated public void setBuildSelfSigned(boolean buildSelfSigned)
micronaut.server.ssl.build-self-signed instead (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(String[] ciphers)
ciphers - The cipherspublic void setProtocols(String[] protocols)
protocols - The protocolspublic void setProtocol(String protocol)
protocol - The protocolpublic void setHandshakeTimeout(@NonNull Duration handshakeTimeout)
handshakeTimeout - The timeout for the SSL handshakeprotected 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