Package org.apache.tomcat.util.net

## Class SSLHostConfig

- java.lang.Object
- - org.apache.tomcat.util.net.SSLHostConfig

All Implemented Interfaces:
  `java.io.Serializable`

    public class SSLHostConfig
    extends java.lang.Object
    implements java.io.Serializable

Represents the TLS configuration for a virtual host.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `SSLHostConfig.CertificateVerification`
`static class` `SSLHostConfig.Type`

### Field Summary

Fields
`protected static java.lang.String` `DEFAULT_SSL_HOST_NAME`
`static java.lang.String` `DEFAULT_TLS_CIPHERS`
`protected static java.util.Set<java.lang.String>` `SSL_PROTO_ALL_SET`

### Constructor Summary

Constructors
`SSLHostConfig()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addCertificate​(SSLHostConfigCertificate certificate)`
`static java.lang.String` `adjustRelativePath​(java.lang.String path)`
`java.util.Set<java.security.cert.X509Certificate>` `certificatesExpiringBefore​(java.util.Date date)`
`java.lang.String` `getCaCertificateFile()`
`java.lang.String` `getCaCertificatePath()`
`java.lang.String` `getCertificateChainFile()`
`java.lang.String` `getCertificateFile()`
`java.lang.String` `getCertificateKeyAlias()`
`java.lang.String` `getCertificateKeyFile()`
`java.lang.String` `getCertificateKeyPassword()`
`java.lang.String` `getCertificateKeystoreFile()`
`java.lang.String` `getCertificateKeystorePassword()`
`java.lang.String` `getCertificateKeystoreProvider()`
`java.lang.String` `getCertificateKeystoreType()`
`java.lang.String` `getCertificateRevocationListFile()`
`java.lang.String` `getCertificateRevocationListPath()`
`java.util.Set<SSLHostConfigCertificate>` `getCertificates()`
`java.util.Set<SSLHostConfigCertificate>` `getCertificates​(boolean createDefaultIfEmpty)`
`SSLHostConfig.CertificateVerification` `getCertificateVerification()`
`java.lang.String` `getCertificateVerificationAsString()`
`int` `getCertificateVerificationDepth()`
`java.util.LinkedHashSet<Cipher>` `getCipherList()`
`java.lang.String` `getCiphers()`
`java.lang.String` `getConfigType()`
`boolean` `getDisableCompression()`
`boolean` `getDisableSessionTickets()`
`java.lang.String[]` `getEnabledCiphers()`
`java.lang.String[]` `getEnabledProtocols()`
`boolean` `getHonorCipherOrder()`
`java.lang.String` `getHostName()`
`boolean` `getInsecureRenegotiation()`
`java.util.List<java.lang.String>` `getJsseCipherNames()` Obtain the list of JSSE cipher names for the current configuration.
`java.lang.String` `getKeyManagerAlgorithm()`
`javax.management.ObjectName` `getObjectName()`
`OpenSSLConf` `getOpenSslConf()`
`java.lang.Long` `getOpenSslConfContext()`
`java.lang.Long` `getOpenSslContext()`
`java.util.Set<java.lang.String>` `getProtocols()`
`boolean` `getRevocationEnabled()`
`int` `getSessionCacheSize()`
`int` `getSessionTimeout()`
`java.lang.String` `getSslProtocol()`
`java.lang.String` `getTrustManagerClassName()`
`java.security.KeyStore` `getTruststore()`
`java.lang.String` `getTruststoreAlgorithm()`
`java.lang.String` `getTruststoreFile()`
`java.lang.String` `getTruststorePassword()`
`java.lang.String` `getTruststoreProvider()`
`java.lang.String` `getTruststoreType()`
`boolean` `isCertificateVerificationDepthConfigured()`
`boolean` `isTls13RenegotiationAvailable()`
`void` `setCaCertificateFile​(java.lang.String caCertificateFile)`
`void` `setCaCertificatePath​(java.lang.String caCertificatePath)`
`void` `setCertificateChainFile​(java.lang.String certificateChainFile)`
`void` `setCertificateFile​(java.lang.String certificateFile)`
`void` `setCertificateKeyAlias​(java.lang.String certificateKeyAlias)`
`void` `setCertificateKeyFile​(java.lang.String certificateKeyFile)`
`void` `setCertificateKeyPassword​(java.lang.String certificateKeyPassword)`
`void` `setCertificateKeystoreFile​(java.lang.String certificateKeystoreFile)`
`void` `setCertificateKeystorePassword​(java.lang.String certificateKeystorePassword)`
`void` `setCertificateKeystoreProvider​(java.lang.String certificateKeystoreProvider)`
`void` `setCertificateKeystoreType​(java.lang.String certificateKeystoreType)`
`void` `setCertificateRevocationListFile​(java.lang.String certificateRevocationListFile)`
`void` `setCertificateRevocationListPath​(java.lang.String certificateRevocationListPath)`
`void` `setCertificateVerification​(java.lang.String certificateVerification)`
`void` `setCertificateVerificationAsString​(java.lang.String certificateVerification)`
`void` `setCertificateVerificationDepth​(int certificateVerificationDepth)`
`void` `setCiphers​(java.lang.String ciphersList)` Set the new cipher configuration.
`void` `setDisableCompression​(boolean disableCompression)`
`void` `setDisableSessionTickets​(boolean disableSessionTickets)`
`void` `setEnabledCiphers​(java.lang.String[] enabledCiphers)`
`void` `setEnabledProtocols​(java.lang.String[] enabledProtocols)`
`void` `setHonorCipherOrder​(boolean honorCipherOrder)`
`void` `setHostName​(java.lang.String hostName)`
`void` `setInsecureRenegotiation​(boolean insecureRenegotiation)`
`void` `setKeyManagerAlgorithm​(java.lang.String keyManagerAlgorithm)`
`void` `setObjectName​(javax.management.ObjectName oname)`
`void` `setOpenSslConf​(OpenSSLConf conf)`
`void` `setOpenSslConfContext​(java.lang.Long openSslConfContext)`
`void` `setOpenSslContext​(java.lang.Long openSslContext)`
`void` `setProtocols​(java.lang.String input)`
`void` `setRevocationEnabled​(boolean revocationEnabled)`
`void` `setSessionCacheSize​(int sessionCacheSize)`
`void` `setSessionTimeout​(int sessionTimeout)`
`void` `setSslProtocol​(java.lang.String sslProtocol)`
`void` `setTls13RenegotiationAvailable​(boolean tls13RenegotiationAvailable)`
`void` `setTrustManagerClassName​(java.lang.String trustManagerClassName)`
`void` `setTrustStore​(java.security.KeyStore truststore)`
`void` `setTruststoreAlgorithm​(java.lang.String truststoreAlgorithm)`
`void` `setTruststoreFile​(java.lang.String truststoreFile)`
`void` `setTruststorePassword​(java.lang.String truststorePassword)`
`void` `setTruststoreProvider​(java.lang.String truststoreProvider)`
`void` `setTruststoreType​(java.lang.String truststoreType)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_SSL_HOST_NAME

    protected static final java.lang.String DEFAULT_SSL_HOST_NAME

See Also:
  Constant Field Values

#### SSL_PROTO_ALL_SET

    protected static final java.util.Set<java.lang.String> SSL_PROTO_ALL_SET

#### DEFAULT_TLS_CIPHERS

    public static final java.lang.String DEFAULT_TLS_CIPHERS

See Also:
  Constant Field Values

### Constructor Detail

#### SSLHostConfig

    public SSLHostConfig()

### Method Detail

#### isTls13RenegotiationAvailable

    public boolean isTls13RenegotiationAvailable()

#### setTls13RenegotiationAvailable

    public void setTls13RenegotiationAvailable​(boolean tls13RenegotiationAvailable)

#### getOpenSslConfContext

    public java.lang.Long getOpenSslConfContext()

#### setOpenSslConfContext

    public void setOpenSslConfContext​(java.lang.Long openSslConfContext)

#### getOpenSslContext

    public java.lang.Long getOpenSslContext()

#### setOpenSslContext

    public void setOpenSslContext​(java.lang.Long openSslContext)

#### getConfigType

    public java.lang.String getConfigType()

#### getEnabledProtocols

    public java.lang.String[] getEnabledProtocols()

Returns:
  The protocols enabled for this TLS virtual host
See Also:
  `SSLUtil.getEnabledProtocols()`

#### setEnabledProtocols

    public void setEnabledProtocols​(java.lang.String[] enabledProtocols)

#### getEnabledCiphers

    public java.lang.String[] getEnabledCiphers()

Returns:
  The ciphers enabled for this TLS virtual host
See Also:
  `SSLUtil.getEnabledCiphers()`

#### setEnabledCiphers

    public void setEnabledCiphers​(java.lang.String[] enabledCiphers)

#### getObjectName

    public javax.management.ObjectName getObjectName()

#### setObjectName

    public void setObjectName​(javax.management.ObjectName oname)

#### addCertificate

    public void addCertificate​(SSLHostConfigCertificate certificate)

#### getOpenSslConf

    public OpenSSLConf getOpenSslConf()

#### setOpenSslConf

    public void setOpenSslConf​(OpenSSLConf conf)

#### getCertificates

    public java.util.Set<SSLHostConfigCertificate> getCertificates()

#### getCertificates

    public java.util.Set<SSLHostConfigCertificate> getCertificates​(boolean createDefaultIfEmpty)

#### getCertificateKeyPassword

    public java.lang.String getCertificateKeyPassword()

#### setCertificateKeyPassword

    public void setCertificateKeyPassword​(java.lang.String certificateKeyPassword)

#### setCertificateRevocationListFile

    public void setCertificateRevocationListFile​(java.lang.String certificateRevocationListFile)

#### getCertificateRevocationListFile

    public java.lang.String getCertificateRevocationListFile()

#### setCertificateVerification

    public void setCertificateVerification​(java.lang.String certificateVerification)

#### getCertificateVerification

    public SSLHostConfig.CertificateVerification getCertificateVerification()

#### setCertificateVerificationAsString

    public void setCertificateVerificationAsString​(java.lang.String certificateVerification)

#### getCertificateVerificationAsString

    public java.lang.String getCertificateVerificationAsString()

#### setCertificateVerificationDepth

    public void setCertificateVerificationDepth​(int certificateVerificationDepth)

#### getCertificateVerificationDepth

    public int getCertificateVerificationDepth()

#### isCertificateVerificationDepthConfigured

    public boolean isCertificateVerificationDepthConfigured()

#### setCiphers

    public void setCiphers​(java.lang.String ciphersList)

Set the new cipher configuration. Note: Regardless of the format used to set the configuration, it is always stored in OpenSSL format.

Parameters:
  `ciphersList` - The new cipher configuration in OpenSSL or JSSE format

#### getCiphers

    public java.lang.String getCiphers()

Returns:
  An OpenSSL cipher string for the current configuration.

#### getCipherList

    public java.util.LinkedHashSet<Cipher> getCipherList()

#### getJsseCipherNames

    public java.util.List<java.lang.String> getJsseCipherNames()

Obtain the list of JSSE cipher names for the current configuration. Ciphers included in the configuration but not supported by JSSE will be excluded from this list.

Returns:
  A list of the JSSE cipher names

#### setHonorCipherOrder

    public void setHonorCipherOrder​(boolean honorCipherOrder)

#### getHonorCipherOrder

    public boolean getHonorCipherOrder()

#### setHostName

    public void setHostName​(java.lang.String hostName)

#### getHostName

    public java.lang.String getHostName()

Returns:
  The host name associated with this SSL configuration - always in lower case.

#### setProtocols

    public void setProtocols​(java.lang.String input)

#### getProtocols

    public java.util.Set<java.lang.String> getProtocols()

#### setSessionCacheSize

    public void setSessionCacheSize​(int sessionCacheSize)

#### getSessionCacheSize

    public int getSessionCacheSize()

#### setSessionTimeout

    public void setSessionTimeout​(int sessionTimeout)

#### getSessionTimeout

    public int getSessionTimeout()

#### getCertificateKeyAlias

    public java.lang.String getCertificateKeyAlias()

#### setCertificateKeyAlias

    public void setCertificateKeyAlias​(java.lang.String certificateKeyAlias)

#### getCertificateKeystoreFile

    public java.lang.String getCertificateKeystoreFile()

#### setCertificateKeystoreFile

    public void setCertificateKeystoreFile​(java.lang.String certificateKeystoreFile)

#### getCertificateKeystorePassword

    public java.lang.String getCertificateKeystorePassword()

#### setCertificateKeystorePassword

    public void setCertificateKeystorePassword​(java.lang.String certificateKeystorePassword)

#### getCertificateKeystoreProvider

    public java.lang.String getCertificateKeystoreProvider()

#### setCertificateKeystoreProvider

    public void setCertificateKeystoreProvider​(java.lang.String certificateKeystoreProvider)

#### getCertificateKeystoreType

    public java.lang.String getCertificateKeystoreType()

#### setCertificateKeystoreType

    public void setCertificateKeystoreType​(java.lang.String certificateKeystoreType)

#### setKeyManagerAlgorithm

    public void setKeyManagerAlgorithm​(java.lang.String keyManagerAlgorithm)

#### getKeyManagerAlgorithm

    public java.lang.String getKeyManagerAlgorithm()

#### setRevocationEnabled

    public void setRevocationEnabled​(boolean revocationEnabled)

#### getRevocationEnabled

    public boolean getRevocationEnabled()

#### setSslProtocol

    public void setSslProtocol​(java.lang.String sslProtocol)

#### getSslProtocol

    public java.lang.String getSslProtocol()

#### setTrustManagerClassName

    public void setTrustManagerClassName​(java.lang.String trustManagerClassName)

#### getTrustManagerClassName

    public java.lang.String getTrustManagerClassName()

#### setTruststoreAlgorithm

    public void setTruststoreAlgorithm​(java.lang.String truststoreAlgorithm)

#### getTruststoreAlgorithm

    public java.lang.String getTruststoreAlgorithm()

#### setTruststoreFile

    public void setTruststoreFile​(java.lang.String truststoreFile)

#### getTruststoreFile

    public java.lang.String getTruststoreFile()

#### setTruststorePassword

    public void setTruststorePassword​(java.lang.String truststorePassword)

#### getTruststorePassword

    public java.lang.String getTruststorePassword()

#### setTruststoreProvider

    public void setTruststoreProvider​(java.lang.String truststoreProvider)

#### getTruststoreProvider

    public java.lang.String getTruststoreProvider()

#### setTruststoreType

    public void setTruststoreType​(java.lang.String truststoreType)

#### getTruststoreType

    public java.lang.String getTruststoreType()

#### setTrustStore

    public void setTrustStore​(java.security.KeyStore truststore)

#### getTruststore

    public java.security.KeyStore getTruststore()
                                         throws java.io.IOException

Throws:
  `java.io.IOException`

#### getCertificateChainFile

    public java.lang.String getCertificateChainFile()

#### setCertificateChainFile

    public void setCertificateChainFile​(java.lang.String certificateChainFile)

#### getCertificateFile

    public java.lang.String getCertificateFile()

#### setCertificateFile

    public void setCertificateFile​(java.lang.String certificateFile)

#### getCertificateKeyFile

    public java.lang.String getCertificateKeyFile()

#### setCertificateKeyFile

    public void setCertificateKeyFile​(java.lang.String certificateKeyFile)

#### setCertificateRevocationListPath

    public void setCertificateRevocationListPath​(java.lang.String certificateRevocationListPath)

#### getCertificateRevocationListPath

    public java.lang.String getCertificateRevocationListPath()

#### setCaCertificateFile

    public void setCaCertificateFile​(java.lang.String caCertificateFile)

#### getCaCertificateFile

    public java.lang.String getCaCertificateFile()

#### setCaCertificatePath

    public void setCaCertificatePath​(java.lang.String caCertificatePath)

#### getCaCertificatePath

    public java.lang.String getCaCertificatePath()

#### setDisableCompression

    public void setDisableCompression​(boolean disableCompression)

#### getDisableCompression

    public boolean getDisableCompression()

#### setDisableSessionTickets

    public void setDisableSessionTickets​(boolean disableSessionTickets)

#### getDisableSessionTickets

    public boolean getDisableSessionTickets()

#### setInsecureRenegotiation

    public void setInsecureRenegotiation​(boolean insecureRenegotiation)

#### getInsecureRenegotiation

    public boolean getInsecureRenegotiation()

#### certificatesExpiringBefore

    public java.util.Set<java.security.cert.X509Certificate> certificatesExpiringBefore​(java.util.Date date)

#### adjustRelativePath

    public static java.lang.String adjustRelativePath​(java.lang.String path)
                                               throws java.io.FileNotFoundException

Throws:
  `java.io.FileNotFoundException`