java.lang.Object
org.springframework.boot.web.server.Ssl

public class Ssl extends Object
Simple server-independent abstraction for SSL configuration.
Since:
2.0.0
Author:
Andy Wilkinson, Vladimir Tsanev, Stephane Nicoll, Scott Frederick
  • 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

      public String getBundle()
      Return the name of the SSL bundle to use.
      Returns:
      the SSL bundle name
      Since:
      3.1.0
    • setBundle

      public void setBundle(String bundle)
      Set the name of the SSL bundle to use.
      Parameters:
      bundle - the SSL bundle name
      Since:
      3.1.0
    • getClientAuth

      public Ssl.ClientAuth 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

      public void setClientAuth(Ssl.ClientAuth clientAuth)
    • getCiphers

      public String[] getCiphers()
      Return the supported SSL ciphers.
      Returns:
      the supported SSL ciphers
    • setCiphers

      public void setCiphers(String[] ciphers)
    • getEnabledProtocols

      public String[] getEnabledProtocols()
      Return the enabled SSL protocols.
      Returns:
      the enabled SSL protocols.
    • setEnabledProtocols

      public void setEnabledProtocols(String[] enabledProtocols)
    • getKeyAlias

      public String getKeyAlias()
      Return the alias that identifies the key in the key store.
      Returns:
      the key alias
    • setKeyAlias

      public void setKeyAlias(String keyAlias)
    • getKeyPassword

      public String getKeyPassword()
      Return the password used to access the key in the key store.
      Returns:
      the key password
    • setKeyPassword

      public void setKeyPassword(String keyPassword)
    • getKeyStore

      public String 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

      public void setKeyStore(String keyStore)
    • getKeyStorePassword

      public String getKeyStorePassword()
      Return the password used to access the key store.
      Returns:
      the key store password
    • setKeyStorePassword

      public void setKeyStorePassword(String keyStorePassword)
    • getKeyStoreType

      public String getKeyStoreType()
      Return the type of the key store.
      Returns:
      the key store type
    • setKeyStoreType

      public void setKeyStoreType(String keyStoreType)
    • getKeyStoreProvider

      public String getKeyStoreProvider()
      Return the provider for the key store.
      Returns:
      the key store provider
    • setKeyStoreProvider

      public void setKeyStoreProvider(String keyStoreProvider)
    • getTrustStore

      public String getTrustStore()
      Return the trust store that holds SSL certificates.
      Returns:
      the trust store
    • setTrustStore

      public void setTrustStore(String trustStore)
    • getTrustStorePassword

      public String getTrustStorePassword()
      Return the password used to access the trust store.
      Returns:
      the trust store password
    • setTrustStorePassword

      public void setTrustStorePassword(String trustStorePassword)
    • getTrustStoreType

      public String getTrustStoreType()
      Return the type of the trust store.
      Returns:
      the trust store type
    • setTrustStoreType

      public void setTrustStoreType(String trustStoreType)
    • getTrustStoreProvider

      public String getTrustStoreProvider()
      Return the provider for the trust store.
      Returns:
      the trust store provider
    • setTrustStoreProvider

      public void setTrustStoreProvider(String trustStoreProvider)
    • getCertificate

      public String getCertificate()
      Return the location of the certificate in PEM format.
      Returns:
      the certificate location
    • setCertificate

      public void setCertificate(String certificate)
    • getCertificatePrivateKey

      public String getCertificatePrivateKey()
      Return the location of the private key for the certificate in PEM format.
      Returns:
      the location of the certificate private key
    • setCertificatePrivateKey

      public void setCertificatePrivateKey(String certificatePrivateKey)
    • getTrustCertificate

      public String getTrustCertificate()
      Return the location of the trust certificate authority chain in PEM format.
      Returns:
      the location of the trust certificate
    • setTrustCertificate

      public void setTrustCertificate(String trustCertificate)
    • getTrustCertificatePrivateKey

      public String 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

      public void setTrustCertificatePrivateKey(String trustCertificatePrivateKey)
    • getProtocol

      public String getProtocol()
      Return the SSL protocol to use.
      Returns:
      the SSL protocol
    • setProtocol

      public void setProtocol(String protocol)
    • isEnabled

      public static boolean isEnabled(Ssl ssl)
      Returns if SSL is enabled for the given instance.
      Parameters:
      ssl - the SSL instance or null
      Returns:
      true is SSL is enabled
      Since:
      3.1.0
    • forBundle

      public static Ssl forBundle(String bundle)
      Factory method to create an Ssl instance for a specific bundle name.
      Parameters:
      bundle - the name of the bundle
      Returns:
      a new Ssl instance with the bundle set
      Since:
      3.1.0