Class OpenSSLContext
- java.lang.Object
-
- org.apache.tomcat.util.net.openssl.OpenSSLContext
-
- All Implemented Interfaces:
SSLContext
public class OpenSSLContext extends java.lang.Object implements SSLContext
-
-
Constructor Summary
Constructors Constructor Description OpenSSLContext(SSLHostConfigCertificate certificate, java.util.List<java.lang.String> negotiableProtocols)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCertificate(SSLHostConfigCertificate certificate)protected static booleanapplyConf(OpenSSLConf conf, long cctx, long ctx)protected static booleancheckConf(OpenSSLConf conf, long cctx)javax.net.ssl.SSLEnginecreateSSLEngine()voiddestroy()protected voidfinalize()java.security.cert.X509Certificate[]getAcceptedIssuers()java.security.cert.X509Certificate[]getCertificateChain(java.lang.String alias)java.lang.StringgetEnabledProtocol()javax.net.ssl.SSLSessionContextgetServerSessionContext()javax.net.ssl.SSLServerSocketFactorygetServerSocketFactory()javax.net.ssl.SSLParametersgetSupportedSSLParameters()voidinit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr)Setup the SSL_CTX.voidsetEnabledProtocol(java.lang.String protocol)
-
-
-
Constructor Detail
-
OpenSSLContext
public OpenSSLContext(SSLHostConfigCertificate certificate, java.util.List<java.lang.String> negotiableProtocols) throws javax.net.ssl.SSLException
- Throws:
javax.net.ssl.SSLException
-
-
Method Detail
-
getEnabledProtocol
public java.lang.String getEnabledProtocol()
-
setEnabledProtocol
public void setEnabledProtocol(java.lang.String protocol)
-
destroy
public void destroy()
- Specified by:
destroyin interfaceSSLContext
-
checkConf
protected static boolean checkConf(OpenSSLConf conf, long cctx) throws java.lang.Exception
- Throws:
java.lang.Exception
-
applyConf
protected static boolean applyConf(OpenSSLConf conf, long cctx, long ctx) throws java.lang.Exception
- Throws:
java.lang.Exception
-
init
public void init(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr)Setup the SSL_CTX.- Specified by:
initin interfaceSSLContext- Parameters:
kms- Must contain a KeyManager of the typeOpenSSLKeyManagertms- Must contain a TrustManager of the typeX509TrustManagersr- Is not used for this implementation.
-
addCertificate
public void addCertificate(SSLHostConfigCertificate certificate) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getServerSessionContext
public javax.net.ssl.SSLSessionContext getServerSessionContext()
- Specified by:
getServerSessionContextin interfaceSSLContext
-
createSSLEngine
public javax.net.ssl.SSLEngine createSSLEngine()
- Specified by:
createSSLEnginein interfaceSSLContext
-
getServerSocketFactory
public javax.net.ssl.SSLServerSocketFactory getServerSocketFactory()
- Specified by:
getServerSocketFactoryin interfaceSSLContext
-
getSupportedSSLParameters
public javax.net.ssl.SSLParameters getSupportedSSLParameters()
- Specified by:
getSupportedSSLParametersin interfaceSSLContext
-
getCertificateChain
public java.security.cert.X509Certificate[] getCertificateChain(java.lang.String alias)
- Specified by:
getCertificateChainin interfaceSSLContext
-
getAcceptedIssuers
public java.security.cert.X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuersin interfaceSSLContext
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-