Class Ssl
java.lang.Object
org.springframework.boot.web.server.Ssl
Simple server-independent abstraction for SSL configuration.
- Since:
- 2.0.0
- Author:
- Andy Wilkinson, Vladimir Tsanev, Stephane Nicoll, Scott Frederick
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Client authentication types.static final record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Ssl
Factory method to create anSsl
instance for a specific bundle name.@Nullable String
Return the name of the SSL bundle to use.@Nullable String
Return the location of the certificate in PEM format.@Nullable String
Return the location of the private key for the certificate in PEM format.String @Nullable []
Return the supported SSL ciphers.@Nullable Ssl.ClientAuth
Return Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need").String @Nullable []
Return the enabled SSL protocols.@Nullable String
Return the alias that identifies the key in the key store.@Nullable String
Return the password used to access the key in the key store.@Nullable String
Return the path to the key store that holds the SSL certificate (typically a jks file).@Nullable String
Return the password used to access the key store.@Nullable String
Return the provider for the key store.@Nullable String
Return the type of the key store.Return the SSL protocol to use.Return the mapping of host names to SSL bundles for SNI configuration.@Nullable String
Return the location of the trust certificate authority chain in PEM format.@Nullable String
Return the location of the private key for the trust certificate in PEM format.@Nullable String
Return the trust store that holds SSL certificates.@Nullable String
Return the password used to access the trust store.@Nullable String
Return the provider for the trust store.@Nullable String
Return the type of the trust store.boolean
Return whether to enable SSL support.static boolean
Returns if SSL is enabled for the given instance.void
Set the name of the SSL bundle to use.void
setCertificate
(@Nullable String certificate) void
setCertificatePrivateKey
(@Nullable String certificatePrivateKey) void
setCiphers
(String @Nullable [] ciphers) void
setClientAuth
(@Nullable Ssl.ClientAuth clientAuth) void
setEnabled
(boolean enabled) void
setEnabledProtocols
(String @Nullable [] enabledProtocols) void
setKeyAlias
(@Nullable String keyAlias) void
setKeyPassword
(@Nullable String keyPassword) void
setKeyStore
(@Nullable String keyStore) void
setKeyStorePassword
(@Nullable String keyStorePassword) void
setKeyStoreProvider
(@Nullable String keyStoreProvider) void
setKeyStoreType
(@Nullable String keyStoreType) void
setProtocol
(String protocol) void
setServerNameBundles
(List<Ssl.ServerNameSslBundle> serverNameBundles) void
setTrustCertificate
(@Nullable String trustCertificate) void
setTrustCertificatePrivateKey
(@Nullable String trustCertificatePrivateKey) void
setTrustStore
(@Nullable String trustStore) void
setTrustStorePassword
(@Nullable String trustStorePassword) void
setTrustStoreProvider
(@Nullable String trustStoreProvider) void
setTrustStoreType
(@Nullable String trustStoreType)
-
Constructor Details
-
Ssl
public Ssl()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Return whether to enable SSL support.- Returns:
- whether to enable SSL support
-
setEnabled
public void setEnabled(boolean enabled) -
getBundle
Return the name of the SSL bundle to use.- Returns:
- the SSL bundle name
- Since:
- 3.1.0
-
setBundle
Set the name of the SSL bundle to use.- Parameters:
bundle
- the SSL bundle name- Since:
- 3.1.0
-
getClientAuth
Return Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need"). Requires a trust store.- Returns:
- the
Ssl.ClientAuth
to use
-
setClientAuth
-
getCiphers
Return the supported SSL ciphers.- Returns:
- the supported SSL ciphers
-
setCiphers
-
getEnabledProtocols
Return the enabled SSL protocols.- Returns:
- the enabled SSL protocols.
-
setEnabledProtocols
-
getKeyAlias
Return the alias that identifies the key in the key store.- Returns:
- the key alias
-
setKeyAlias
-
getKeyPassword
Return the password used to access the key in the key store.- Returns:
- the key password
-
setKeyPassword
-
getKeyStore
Return the path to the key store that holds the SSL certificate (typically a jks file).- Returns:
- the path to the key store
-
setKeyStore
-
getKeyStorePassword
Return the password used to access the key store.- Returns:
- the key store password
-
setKeyStorePassword
-
getKeyStoreType
Return the type of the key store.- Returns:
- the key store type
-
setKeyStoreType
-
getKeyStoreProvider
Return the provider for the key store.- Returns:
- the key store provider
-
setKeyStoreProvider
-
getTrustStore
Return the trust store that holds SSL certificates.- Returns:
- the trust store
-
setTrustStore
-
getTrustStorePassword
Return the password used to access the trust store.- Returns:
- the trust store password
-
setTrustStorePassword
-
getTrustStoreType
Return the type of the trust store.- Returns:
- the trust store type
-
setTrustStoreType
-
getTrustStoreProvider
Return the provider for the trust store.- Returns:
- the trust store provider
-
setTrustStoreProvider
-
getCertificate
Return the location of the certificate in PEM format.- Returns:
- the certificate location
-
setCertificate
-
getCertificatePrivateKey
Return the location of the private key for the certificate in PEM format.- Returns:
- the location of the certificate private key
-
setCertificatePrivateKey
-
getTrustCertificate
Return the location of the trust certificate authority chain in PEM format.- Returns:
- the location of the trust certificate
-
setTrustCertificate
-
getTrustCertificatePrivateKey
Return the location of the private key for the trust certificate in PEM format.- Returns:
- the location of the trust certificate private key
-
setTrustCertificatePrivateKey
-
getProtocol
-
setProtocol
-
isEnabled
-
getServerNameBundles
Return the mapping of host names to SSL bundles for SNI configuration.- Returns:
- the host name to SSL bundle mapping
-
setServerNameBundles
-
forBundle
-