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 enumClient authentication types.static final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SslFactory method to create anSslinstance for a specific bundle name.Return the name of the SSL bundle to use.Return the location of the certificate in PEM format.Return the location of the private key for the certificate in PEM format.Return the supported SSL ciphers.Return Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need").Return the enabled SSL protocols.Return the alias that identifies the key in the key store.Return the password used to access the key in the key store.Return the path to the key store that holds the SSL certificate (typically a jks file).Return the password used to access the key store.Return the provider for the key store.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.Return the location of the trust certificate authority chain in PEM format.Return the location of the private key for the trust certificate in PEM format.Return the trust store that holds SSL certificates.Return the password used to access the trust store.Return the provider for the trust store.Return the type of the trust store.booleanReturn whether to enable SSL support.static booleanReturns if SSL is enabled for the given instance.voidSet the name of the SSL bundle to use.voidsetCertificate(@Nullable String certificate) voidsetCertificatePrivateKey(@Nullable String certificatePrivateKey) voidsetCiphers(String @Nullable [] ciphers) voidsetClientAuth(@Nullable Ssl.ClientAuth clientAuth) voidsetEnabled(boolean enabled) voidsetEnabledProtocols(String @Nullable [] enabledProtocols) voidsetKeyAlias(@Nullable String keyAlias) voidsetKeyPassword(@Nullable String keyPassword) voidsetKeyStore(@Nullable String keyStore) voidsetKeyStorePassword(@Nullable String keyStorePassword) voidsetKeyStoreProvider(@Nullable String keyStoreProvider) voidsetKeyStoreType(@Nullable String keyStoreType) voidsetProtocol(String protocol) voidsetServerNameBundles(List<Ssl.ServerNameSslBundle> serverNameBundles) voidsetTrustCertificate(@Nullable String trustCertificate) voidsetTrustCertificatePrivateKey(@Nullable String trustCertificatePrivateKey) voidsetTrustStore(@Nullable String trustStore) voidsetTrustStorePassword(@Nullable String trustStorePassword) voidsetTrustStoreProvider(@Nullable String trustStoreProvider) voidsetTrustStoreType(@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
-
setBundle
-
getClientAuth
Return Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need"). Requires a trust store.- Returns:
- the
Ssl.ClientAuthto use
-
setClientAuth
-
getCiphers
-
setCiphers
-
getEnabledProtocols
-
setEnabledProtocols
-
getKeyAlias
-
setKeyAlias
-
getKeyPassword
-
setKeyPassword
-
getKeyStore
-
setKeyStore
-
getKeyStorePassword
-
setKeyStorePassword
-
getKeyStoreType
-
setKeyStoreType
-
getKeyStoreProvider
-
setKeyStoreProvider
-
getTrustStore
-
setTrustStore
-
getTrustStorePassword
-
setTrustStorePassword
-
getTrustStoreType
-
setTrustStoreType
-
getTrustStoreProvider
-
setTrustStoreProvider
-
getCertificate
-
setCertificate
-
getCertificatePrivateKey
-
setCertificatePrivateKey
-
getTrustCertificate
-
setTrustCertificate
-
getTrustCertificatePrivateKey
-
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
-