Top Description Inners Fields Constructors Methods
org.apache.tomcat.util.net

public Class SSLHostConfig

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.File, .FileNotFoundException, .IOException, .Serializable, java.security.KeyStore, .UnrecoverableKeyException, java.security.cert.X509Certificate, java.util.Date, .HashSet, .LinkedHashSet, .List, .Locale, .Set, javax.management.ObjectName, javax.net.ssl.KeyManagerFactory, .TrustManagerFactory, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.net.openssl.OpenSSLConf, org.apache.tomcat.util.net.openssl.ciphers.Cipher, .OpenSSLCipherConfigurationParser, org.apache.tomcat.util.res.StringManager

Represents the TLS configuration for a virtual host.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
private String
private String
private String
private String
private Set<SSLHostConfigCertificate>
private SSLHostConfig.CertificateVerification
private int
private boolean
private LinkedHashSet<Cipher>
private String
private SSLHostConfig.Type
protected static final String
public static final String
private SSLHostConfigCertificate
private boolean
private boolean
private String[]
private String[]
private Set<String>
private boolean
private String
private boolean
private List<String>
private String
private static final Log
private ObjectName
private OpenSSLConf
private transient volatile Long
private transient volatile Long
private Set<String>
private boolean
private static final long
private int
private int
private static final StringManager
protected static final Set<String>
private String
private boolean
private String
private transient KeyStore
private String
private String
private String
private String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public static String
public Set<X509Certificate>
public String
public String
public String
public String
public Set<SSLHostConfigCertificate>
public Set<SSLHostConfigCertificate>
getCertificates(boolean createDefaultIfEmpty)

public SSLHostConfig.CertificateVerification
public String
public int
public LinkedHashSet<Cipher>
public String

Returns:

An OpenSSL cipher string for the current configuration.
getCiphers
()

public String
public boolean
public boolean
public String[]

Returns:

The ciphers enabled for this TLS virtual host
getEnabledCiphers
()

public String[]

Returns:

The protocols enabled for this TLS virtual host
getEnabledProtocols
()

public boolean
public String

Returns:

The host name associated with this SSL configuration - always in lower case.
getHostName
()

public boolean
public List<String>

Returns:

A list of the JSSE cipher names
getJsseCipherNames
()

Obtain the list of JSSE cipher names for the current configuration.

public String
public ObjectName
public OpenSSLConf
public Long
public Long
public Set<String>
public boolean
public int
public int
public String
public String
public KeyStore
public String
public String
public String
public String
public String
public boolean
pack-priv boolean
public boolean
private void
public void
setCaCertificateFile(String caCertificateFile)

public void
setCaCertificatePath(String caCertificatePath)

public void
setCertificateRevocationListFile(String certificateRevocationListFile)

public void
setCertificateRevocationListPath(String certificateRevocationListPath)

public void
setCertificateVerification(String certificateVerification)

public void
setCertificateVerificationAsString(String certificateVerification)

public void
setCertificateVerificationDepth(int certificateVerificationDepth)

public void
setCiphers(String
The new cipher configuration in OpenSSL or JSSE format
ciphersList
)

Set the new cipher configuration.

public void
setDisableCompression(boolean disableCompression)

public void
setDisableSessionTickets(boolean disableSessionTickets)

public void
setEnabledCiphers(String[] enabledCiphers)

public void
setEnabledProtocols(String[] enabledProtocols)

public void
setHonorCipherOrder(boolean honorCipherOrder)

public void
setHostName(String hostName)

public void
setInsecureRenegotiation(boolean insecureRenegotiation)

public void
setKeyManagerAlgorithm(String keyManagerAlgorithm)

public void
public void
public void
setOpenSslConfContext(Long openSslConfContext)

public void
setOpenSslContext(Long openSslContext)

pack-priv boolean

Returns:

true if the property belongs to the current configuration, and false otherwise
setProperty
(String
the property name
name
,
SSLHostConfig.Type
the configuration type
configType
)

Set property which belongs to the specified configuration type.

public void
public void
setRevocationEnabled(boolean revocationEnabled)

public void
setSessionCacheSize(int sessionCacheSize)

public void
setSessionTimeout(int sessionTimeout)

public void
setSslProtocol(String sslProtocol)

public void
setTls13RenegotiationAvailable(boolean tls13RenegotiationAvailable)

public void
setTrustManagerClassName(String trustManagerClassName)

public void
setTrustStore(KeyStore truststore)

public void
setTruststoreAlgorithm(String truststoreAlgorithm)

public void
setTruststoreFile(String truststoreFile)

public void
setTruststorePassword(String truststorePassword)

public void
setTruststoreProvider(String truststoreProvider)

public void
setTruststoreType(String truststoreType)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

caCertificateFileback to summary
private String caCertificateFile
caCertificatePathback to summary
private String caCertificatePath
certificateRevocationListFileback to summary
private String certificateRevocationListFile
certificateRevocationListPathback to summary
private String certificateRevocationListPath
certificatesback to summary
private Set<SSLHostConfigCertificate> certificates
certificateVerificationback to summary
private SSLHostConfig.CertificateVerification certificateVerification
certificateVerificationDepthback to summary
private int certificateVerificationDepth
certificateVerificationDepthConfiguredback to summary
private boolean certificateVerificationDepthConfigured
cipherListback to summary
private LinkedHashSet<Cipher> cipherList
ciphersback to summary
private String ciphers
configTypeback to summary
private SSLHostConfig.Type configType
DEFAULT_SSL_HOST_NAMEback to summary
protected static final String DEFAULT_SSL_HOST_NAME
DEFAULT_TLS_CIPHERSback to summary
public static final String DEFAULT_TLS_CIPHERS
defaultCertificateback to summary
private SSLHostConfigCertificate defaultCertificate
disableCompressionback to summary
private boolean disableCompression
disableSessionTicketsback to summary
private boolean disableSessionTickets
enabledCiphersback to summary
private String[] enabledCiphers
enabledProtocolsback to summary
private String[] enabledProtocols
explicitlyRequestedProtocolsback to summary
private Set<String> explicitlyRequestedProtocols
honorCipherOrderback to summary
private boolean honorCipherOrder
hostNameback to summary
private String hostName
insecureRenegotiationback to summary
private boolean insecureRenegotiation
jsseCipherNamesback to summary
private List<String> jsseCipherNames
keyManagerAlgorithmback to summary
private String keyManagerAlgorithm
logback to summary
private static final Log log
onameback to summary
private ObjectName oname
openSslConfback to summary
private OpenSSLConf openSslConf
openSslConfContextback to summary
private transient volatile Long openSslConfContext
openSslContextback to summary
private transient volatile Long openSslContext
protocolsback to summary
private Set<String> protocols
revocationEnabledback to summary
private boolean revocationEnabled
serialVersionUIDback to summary
private static final long serialVersionUID
sessionCacheSizeback to summary
private int sessionCacheSize
sessionTimeoutback to summary
private int sessionTimeout
smback to summary
private static final StringManager sm
SSL_PROTO_ALL_SETback to summary
protected static final Set<String> SSL_PROTO_ALL_SET
sslProtocolback to summary
private String sslProtocol
tls13RenegotiationAvailableback to summary
private boolean tls13RenegotiationAvailable
trustManagerClassNameback to summary
private String trustManagerClassName
truststoreback to summary
private transient KeyStore truststore
truststoreAlgorithmback to summary
private String truststoreAlgorithm
truststoreFileback to summary
private String truststoreFile
truststorePasswordback to summary
private String truststorePassword
truststoreProviderback to summary
private String truststoreProvider
truststoreTypeback to summary
private String truststoreType

Constructor Detail

SSLHostConfigback to summary
public SSLHostConfig()

Method Detail

addCertificateback to summary
public void addCertificate(SSLHostConfigCertificate certificate)
adjustRelativePathback to summary
public static String adjustRelativePath(String path) throws FileNotFoundException
certificatesExpiringBeforeback to summary
public Set<X509Certificate> certificatesExpiringBefore(Date date)
getCaCertificateFileback to summary
public String getCaCertificateFile()
getCaCertificatePathback to summary
public String getCaCertificatePath()
getCertificateRevocationListFileback to summary
public String getCertificateRevocationListFile()
getCertificateRevocationListPathback to summary
public String getCertificateRevocationListPath()
getCertificatesback to summary
public Set<SSLHostConfigCertificate> getCertificates()
getCertificatesback to summary
public Set<SSLHostConfigCertificate> getCertificates(boolean createDefaultIfEmpty)
getCertificateVerificationback to summary
public SSLHostConfig.CertificateVerification getCertificateVerification()
getCertificateVerificationAsStringback to summary
public String getCertificateVerificationAsString()
getCertificateVerificationDepthback to summary
public int getCertificateVerificationDepth()
getCipherListback to summary
public LinkedHashSet<Cipher> getCipherList()
getCiphersback to summary
public String getCiphers()
Returns:String

An OpenSSL cipher string for the current configuration.

getConfigTypeback to summary
public String getConfigType()
getDisableCompressionback to summary
public boolean getDisableCompression()
getDisableSessionTicketsback to summary
public boolean getDisableSessionTickets()
getEnabledCiphersback to summary
public String[] getEnabledCiphers()
Returns:String[]

The ciphers enabled for this TLS virtual host

See Also
SSLUtil#getEnabledCiphers()
getEnabledProtocolsback to summary
public String[] getEnabledProtocols()
Returns:String[]

The protocols enabled for this TLS virtual host

See Also
SSLUtil#getEnabledProtocols()
getHonorCipherOrderback to summary
public boolean getHonorCipherOrder()
getHostNameback to summary
public String getHostName()
Returns:String

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

getInsecureRenegotiationback to summary
public boolean getInsecureRenegotiation()
getJsseCipherNamesback to summary
public List<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:List<String>

A list of the JSSE cipher names

getKeyManagerAlgorithmback to summary
public String getKeyManagerAlgorithm()
getObjectNameback to summary
public ObjectName getObjectName()
getOpenSslConfback to summary
public OpenSSLConf getOpenSslConf()
getOpenSslConfContextback to summary
public Long getOpenSslConfContext()
getOpenSslContextback to summary
public Long getOpenSslContext()
getProtocolsback to summary
public Set<String> getProtocols()
getRevocationEnabledback to summary
public boolean getRevocationEnabled()
getSessionCacheSizeback to summary
public int getSessionCacheSize()
getSessionTimeoutback to summary
public int getSessionTimeout()
getSslProtocolback to summary
public String getSslProtocol()
getTrustManagerClassNameback to summary
public String getTrustManagerClassName()
getTruststoreback to summary
public KeyStore getTruststore() throws IOException
getTruststoreAlgorithmback to summary
public String getTruststoreAlgorithm()
getTruststoreFileback to summary
public String getTruststoreFile()
getTruststorePasswordback to summary
public String getTruststorePassword()
getTruststoreProviderback to summary
public String getTruststoreProvider()
getTruststoreTypeback to summary
public String getTruststoreType()
isCertificateVerificationDepthConfiguredback to summary
public boolean isCertificateVerificationDepthConfigured()
isExplicitlyRequestedProtocolback to summary
pack-priv boolean isExplicitlyRequestedProtocol(String protocol)
isTls13RenegotiationAvailableback to summary
public boolean isTls13RenegotiationAvailable()
registerDefaultCertificateback to summary
private void registerDefaultCertificate()
setCaCertificateFileback to summary
public void setCaCertificateFile(String caCertificateFile)
setCaCertificatePathback to summary
public void setCaCertificatePath(String caCertificatePath)
setCertificateRevocationListFileback to summary
public void setCertificateRevocationListFile(String certificateRevocationListFile)
setCertificateRevocationListPathback to summary
public void setCertificateRevocationListPath(String certificateRevocationListPath)
setCertificateVerificationback to summary
public void setCertificateVerification(String certificateVerification)
setCertificateVerificationAsStringback to summary
public void setCertificateVerificationAsString(String certificateVerification)
setCertificateVerificationDepthback to summary
public void setCertificateVerificationDepth(int certificateVerificationDepth)
setCiphersback to summary
public void setCiphers(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:String

The new cipher configuration in OpenSSL or JSSE format

setDisableCompressionback to summary
public void setDisableCompression(boolean disableCompression)
setDisableSessionTicketsback to summary
public void setDisableSessionTickets(boolean disableSessionTickets)
setEnabledCiphersback to summary
public void setEnabledCiphers(String[] enabledCiphers)
setEnabledProtocolsback to summary
public void setEnabledProtocols(String[] enabledProtocols)
setHonorCipherOrderback to summary
public void setHonorCipherOrder(boolean honorCipherOrder)
setHostNameback to summary
public void setHostName(String hostName)
setInsecureRenegotiationback to summary
public void setInsecureRenegotiation(boolean insecureRenegotiation)
setKeyManagerAlgorithmback to summary
public void setKeyManagerAlgorithm(String keyManagerAlgorithm)
setObjectNameback to summary
public void setObjectName(ObjectName oname)
setOpenSslConfback to summary
public void setOpenSslConf(OpenSSLConf conf)
setOpenSslConfContextback to summary
public void setOpenSslConfContext(Long openSslConfContext)
setOpenSslContextback to summary
public void setOpenSslContext(Long openSslContext)
setPropertyback to summary
pack-priv boolean setProperty(String name, SSLHostConfig.Type configType)

Set property which belongs to the specified configuration type.

Parameters
name:String

the property name

configType:SSLHostConfig.Type

the configuration type

Returns:boolean

true if the property belongs to the current configuration, and false otherwise

setProtocolsback to summary
public void setProtocols(String input)
setRevocationEnabledback to summary
public void setRevocationEnabled(boolean revocationEnabled)
setSessionCacheSizeback to summary
public void setSessionCacheSize(int sessionCacheSize)
setSessionTimeoutback to summary
public void setSessionTimeout(int sessionTimeout)
setSslProtocolback to summary
public void setSslProtocol(String sslProtocol)
setTls13RenegotiationAvailableback to summary
public void setTls13RenegotiationAvailable(boolean tls13RenegotiationAvailable)
setTrustManagerClassNameback to summary
public void setTrustManagerClassName(String trustManagerClassName)
setTrustStoreback to summary
public void setTrustStore(KeyStore truststore)
setTruststoreAlgorithmback to summary
public void setTruststoreAlgorithm(String truststoreAlgorithm)
setTruststoreFileback to summary
public void setTruststoreFile(String truststoreFile)
setTruststorePasswordback to summary
public void setTruststorePassword(String truststorePassword)
setTruststoreProviderback to summary
public void setTruststoreProvider(String truststoreProvider)
setTruststoreTypeback to summary
public void setTruststoreType(String truststoreType)
org.apache.tomcat.util.net back to summary

public final Enum SSLHostConfig.CertificateVerification

extends Enum<SSLHostConfig.CertificateVerification>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SSLHostConfig.CertificateVerification
public static final SSLHostConfig.CertificateVerification
private final boolean
public static final SSLHostConfig.CertificateVerification
public static final SSLHostConfig.CertificateVerification

Constructor Summary

AccessConstructor and Description
private
CertificateVerification(boolean optional)

Method Summary

Modifier and TypeMethod and Description
public static SSLHostConfig.CertificateVerification
public boolean
public static SSLHostConfig.CertificateVerification
public static SSLHostConfig.CertificateVerification[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

NONEback to summary
public static final SSLHostConfig.CertificateVerification NONE
OPTIONALback to summary
public static final SSLHostConfig.CertificateVerification OPTIONAL
optionalback to summary
private final boolean optional
OPTIONAL_NO_CAback to summary
public static final SSLHostConfig.CertificateVerification OPTIONAL_NO_CA
REQUIREDback to summary
public static final SSLHostConfig.CertificateVerification REQUIRED

Constructor Detail

CertificateVerificationback to summary
private CertificateVerification(boolean optional)

Method Detail

fromStringback to summary
public static SSLHostConfig.CertificateVerification fromString(String value)
isOptionalback to summary
public boolean isOptional()
valueOfback to summary
public static SSLHostConfig.CertificateVerification valueOf(String name)
valuesback to summary
public static SSLHostConfig.CertificateVerification[] values()
org.apache.tomcat.util.net back to summary

public final Enum SSLHostConfig.Type

extends Enum<SSLHostConfig.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SSLHostConfig.Type
public static final SSLHostConfig.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static SSLHostConfig.Type
public static SSLHostConfig.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

JSSEback to summary
public static final SSLHostConfig.Type JSSE
OPENSSLback to summary
public static final SSLHostConfig.Type OPENSSL

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static SSLHostConfig.Type valueOf(String name)
valuesback to summary
public static SSLHostConfig.Type[] values()