Class OpenSSLContext
- java.lang.Object
-
- org.apache.tomcat.util.net.openssl.OpenSSLContext
-
- All Implemented Interfaces:
SSLContext
public class OpenSSLContext extends Object implements SSLContext
-
-
Constructor Summary
Constructors Constructor Description OpenSSLContext(SSLHostConfigCertificate certificate, List<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)SSLEnginecreateSSLEngine()voiddestroy()X509Certificate[]getAcceptedIssuers()X509Certificate[]getCertificateChain(String alias)StringgetEnabledProtocol()SSLSessionContextgetServerSessionContext()SSLServerSocketFactorygetServerSocketFactory()SSLParametersgetSupportedSSLParameters()voidinit(KeyManager[] kms, TrustManager[] tms, SecureRandom sr)Setup the SSL_CTX.voidsetEnabledProtocol(String protocol)
-
-
-
Constructor Detail
-
OpenSSLContext
public OpenSSLContext(SSLHostConfigCertificate certificate, List<String> negotiableProtocols) throws SSLException
- Throws:
SSLException
-
-
Method Detail
-
getEnabledProtocol
public String getEnabledProtocol()
-
setEnabledProtocol
public void setEnabledProtocol(String protocol)
-
destroy
public void destroy()
- Specified by:
destroyin interfaceSSLContext
-
checkConf
protected static boolean checkConf(OpenSSLConf conf, long cctx) throws Exception
- Throws:
Exception
-
applyConf
protected static boolean applyConf(OpenSSLConf conf, long cctx, long ctx) throws Exception
- Throws:
Exception
-
init
public void init(KeyManager[] kms, TrustManager[] tms, 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 Exception
- Throws:
Exception
-
getServerSessionContext
public SSLSessionContext getServerSessionContext()
- Specified by:
getServerSessionContextin interfaceSSLContext
-
createSSLEngine
public SSLEngine createSSLEngine()
- Specified by:
createSSLEnginein interfaceSSLContext
-
getServerSocketFactory
public SSLServerSocketFactory getServerSocketFactory()
- Specified by:
getServerSocketFactoryin interfaceSSLContext
-
getSupportedSSLParameters
public SSLParameters getSupportedSSLParameters()
- Specified by:
getSupportedSSLParametersin interfaceSSLContext
-
getCertificateChain
public X509Certificate[] getCertificateChain(String alias)
- Specified by:
getCertificateChainin interfaceSSLContext
-
getAcceptedIssuers
public X509Certificate[] getAcceptedIssuers()
- Specified by:
getAcceptedIssuersin interfaceSSLContext
-
-