Class SSLUtilBase
java.lang.Object
org.apache.tomcat.util.net.SSLUtilBase
- All Implemented Interfaces:
SSLUtil
- Direct Known Subclasses:
JSSEUtil, OpenSSLUtil
-
Nested Class Summary
Nested classes/interfaces inherited from interface SSLUtil
SSLUtil.ProtocolInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SSLHostConfigCertificateThe SSL host configuration certificate.static final StringDefault key alias.protected final SSLHostConfigThe SSL host configuration. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSSLUtilBase(SSLHostConfigCertificate certificate) Constructor.protectedSSLUtilBase(SSLHostConfigCertificate certificate, boolean warnTls13) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureSessionContext(SSLSessionContext sslSessionContext) Configures the given SSL session context.final SSLContextcreateSSLContext(List<String> negotiableProtocols) Creates an SSL context for the given negotiable protocols.protected abstract SSLContextcreateSSLContextInternal(List<String> negotiableProtocols) Creates an SSL context with the given negotiable protocols.protected Collection<? extends CRL> Load the collection of CRLs.String[]The set of enabled ciphers is the intersection of the implemented ciphers and the configured ciphers.String[]The set of enabled protocols is the intersection of the implemented protocols and the configured protocols.Returns the set of implemented SSL/TLS ciphers.Returns the set of implemented SSL/TLS protocols.Returns the key managers.protected abstract LoggetLog()Returns the log for this utility.protected CertPathParametersgetParameters(String crlf, KeyStore trustStore, boolean revocationEnabled) Return the initialization parameters for the TrustManager.Returns the trust managers.protected abstract booleanReturns whether TLS 1.3 renegotiation authentication is available.
-
Field Details
-
DEFAULT_KEY_ALIAS
-
sslHostConfig
The SSL host configuration. -
certificate
The SSL host configuration certificate.
-
-
Constructor Details
-
SSLUtilBase
Constructor.- Parameters:
certificate- The SSL host configuration certificate
-
SSLUtilBase
Constructor.- Parameters:
certificate- The SSL host configuration certificatewarnTls13- Whether to warn about TLS 1.3 issues
-
-
Method Details
-
createSSLContext
Description copied from interface:SSLUtilCreates an SSL context for the given negotiable protocols.- Specified by:
createSSLContextin interfaceSSLUtil- Parameters:
negotiableProtocols- The negotiable protocols- Returns:
- the SSL context
- Throws:
Exception- if an error occurs
-
configureSessionContext
Description copied from interface:SSLUtilConfigures the given SSL session context.- Specified by:
configureSessionContextin interfaceSSLUtil- Parameters:
sslSessionContext- The SSL session context to configure
-
getKeyManagers
Description copied from interface:SSLUtilReturns the key managers.- Specified by:
getKeyManagersin interfaceSSLUtil- Returns:
- The key managers
- Throws:
Exception- if an error occurs
-
getEnabledProtocols
Description copied from interface:SSLUtilThe set of enabled protocols is the intersection of the implemented protocols and the configured protocols. If no protocols are explicitly configured, then all of the implemented protocols will be included in the returned array.- Specified by:
getEnabledProtocolsin interfaceSSLUtil- Returns:
- The protocols currently enabled and available for clients to select from for the associated connection
-
getEnabledCiphers
Description copied from interface:SSLUtilThe set of enabled ciphers is the intersection of the implemented ciphers and the configured ciphers. If no ciphers are explicitly configured, then the default ciphers will be included in the returned array.The ciphers used during the TLS handshake may be further restricted by the
SSLUtil.getEnabledProtocols()and the certificates.- Specified by:
getEnabledCiphersin interfaceSSLUtil- Returns:
- The ciphers currently enabled and available for clients to select from for the associated connection
-
getTrustManagers
Description copied from interface:SSLUtilReturns the trust managers.- Specified by:
getTrustManagersin interfaceSSLUtil- Returns:
- The trust managers
- Throws:
Exception- if an error occurs
-
getParameters
protected CertPathParameters getParameters(String crlf, KeyStore trustStore, boolean revocationEnabled) throws Exception Return the initialization parameters for the TrustManager. Currently, only the defaultPKIXis supported.- Parameters:
crlf- The path to the CRL file.trustStore- The configured TrustStore.revocationEnabled- Should the JSSE provider perform revocation checks? Ignored ifcrlfis non-null. Configuration of revocation checks are expected to be via proprietary JSSE provider methods.- Returns:
- The parameters including the CRLs and TrustStore.
- Throws:
Exception- An error occurred
-
getCRLs
protected Collection<? extends CRL> getCRLs(String crlf) throws IOException, CRLException, CertificateException Load the collection of CRLs.- Parameters:
crlf- The path to the CRL file.- Returns:
- the CRLs collection
- Throws:
IOException- Error reading CRL fileCRLException- CRL errorCertificateException- Error processing certificate
-
getImplementedProtocols
-
getImplementedCiphers
-
getLog
-
isTls13RenegAuthAvailable
protected abstract boolean isTls13RenegAuthAvailable()Returns whether TLS 1.3 renegotiation authentication is available.- Returns:
trueif TLS 1.3 renegotiation authentication is available
-
createSSLContextInternal
protected abstract SSLContext createSSLContextInternal(List<String> negotiableProtocols) throws Exception Creates an SSL context with the given negotiable protocols.- Parameters:
negotiableProtocols- The negotiable protocols- Returns:
- the SSL context
- Throws:
Exception- if creation fails
-