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 SummaryNested ClassesModifier and TypeClassDescriptionstatic enumClient authentication types.static final record
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.String[]Return the supported SSL ciphers.Return Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need").String[]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(String certificate) voidsetCertificatePrivateKey(String certificatePrivateKey) voidsetCiphers(String[] ciphers) voidsetClientAuth(Ssl.ClientAuth clientAuth) voidsetEnabled(boolean enabled) voidsetEnabledProtocols(String[] enabledProtocols) voidsetKeyAlias(String keyAlias) voidsetKeyPassword(String keyPassword) voidsetKeyStore(String keyStore) voidsetKeyStorePassword(String keyStorePassword) voidsetKeyStoreProvider(String keyStoreProvider) voidsetKeyStoreType(String keyStoreType) voidsetProtocol(String protocol) voidsetServerNameBundles(List<Ssl.ServerNameSslBundle> serverNameBundles) voidsetTrustCertificate(String trustCertificate) voidsetTrustCertificatePrivateKey(String trustCertificatePrivateKey) voidsetTrustStore(String trustStore) voidsetTrustStorePassword(String trustStorePassword) voidsetTrustStoreProvider(String trustStoreProvider) voidsetTrustStoreType(String trustStoreType) 
- 
Constructor Details- 
Sslpublic Ssl()
 
- 
- 
Method Details- 
isEnabledpublic boolean isEnabled()Return whether to enable SSL support.- Returns:
- whether to enable SSL support
 
- 
setEnabledpublic void setEnabled(boolean enabled) 
- 
getBundleReturn the name of the SSL bundle to use.- Returns:
- the SSL bundle name
- Since:
- 3.1.0
 
- 
setBundleSet the name of the SSL bundle to use.- Parameters:
- bundle- the SSL bundle name
- Since:
- 3.1.0
 
- 
getClientAuthReturn Whether client authentication is not wanted ("none"), wanted ("want") or needed ("need"). Requires a trust store.- Returns:
- the Ssl.ClientAuthto use
 
- 
setClientAuth
- 
getCiphersReturn the supported SSL ciphers.- Returns:
- the supported SSL ciphers
 
- 
setCiphers
- 
getEnabledProtocolsReturn the enabled SSL protocols.- Returns:
- the enabled SSL protocols.
 
- 
setEnabledProtocols
- 
getKeyAliasReturn the alias that identifies the key in the key store.- Returns:
- the key alias
 
- 
setKeyAlias
- 
getKeyPasswordReturn the password used to access the key in the key store.- Returns:
- the key password
 
- 
setKeyPassword
- 
getKeyStoreReturn the path to the key store that holds the SSL certificate (typically a jks file).- Returns:
- the path to the key store
 
- 
setKeyStore
- 
getKeyStorePasswordReturn the password used to access the key store.- Returns:
- the key store password
 
- 
setKeyStorePassword
- 
getKeyStoreTypeReturn the type of the key store.- Returns:
- the key store type
 
- 
setKeyStoreType
- 
getKeyStoreProviderReturn the provider for the key store.- Returns:
- the key store provider
 
- 
setKeyStoreProvider
- 
getTrustStoreReturn the trust store that holds SSL certificates.- Returns:
- the trust store
 
- 
setTrustStore
- 
getTrustStorePasswordReturn the password used to access the trust store.- Returns:
- the trust store password
 
- 
setTrustStorePassword
- 
getTrustStoreTypeReturn the type of the trust store.- Returns:
- the trust store type
 
- 
setTrustStoreType
- 
getTrustStoreProviderReturn the provider for the trust store.- Returns:
- the trust store provider
 
- 
setTrustStoreProvider
- 
getCertificateReturn the location of the certificate in PEM format.- Returns:
- the certificate location
 
- 
setCertificate
- 
getCertificatePrivateKeyReturn the location of the private key for the certificate in PEM format.- Returns:
- the location of the certificate private key
 
- 
setCertificatePrivateKey
- 
getTrustCertificateReturn the location of the trust certificate authority chain in PEM format.- Returns:
- the location of the trust certificate
 
- 
setTrustCertificate
- 
getTrustCertificatePrivateKeyReturn the location of the private key for the trust certificate in PEM format.- Returns:
- the location of the trust certificate private key
 
- 
setTrustCertificatePrivateKey
- 
getProtocolReturn the SSL protocol to use.- Returns:
- the SSL protocol
 
- 
setProtocol
- 
isEnabledReturns if SSL is enabled for the given instance.- Parameters:
- ssl- the- SSLinstance or- null
- Returns:
- trueif SSL is enabled
- Since:
- 3.1.0
 
- 
getServerNameBundlesReturn the mapping of host names to SSL bundles for SNI configuration.- Returns:
- the host name to SSL bundle mapping
 
- 
setServerNameBundles
- 
forBundleFactory method to create anSslinstance for a specific bundle name.- Parameters:
- bundle- the name of the bundle
- Returns:
- a new Sslinstance with the bundle set
- Since:
- 3.1.0
 
 
-