Package org.conscrypt
Class OpenSSLContextImpl
- java.lang.Object
-
- javax.net.ssl.SSLContextSpi
-
- org.conscrypt.OpenSSLContextImpl
-
- Direct Known Subclasses:
DefaultSSLContextImpl,OpenSSLContextImpl.TLSv1,OpenSSLContextImpl.TLSv11,OpenSSLContextImpl.TLSv12,OpenSSLContextImpl.TLSv13
@Internal public abstract class OpenSSLContextImpl extends javax.net.ssl.SSLContextSpi
OpenSSL-backed SSLContext service provider interface.Public to allow contruction via the provider framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenSSLContextImpl.TLSv1Public to allow construction via the provider framework.static classOpenSSLContextImpl.TLSv11Public to allow construction via the provider framework.static classOpenSSLContextImpl.TLSv12Public to allow construction via the provider framework.static classOpenSSLContextImpl.TLSv13Public to allow construction via the provider framework.
-
Field Summary
Fields Modifier and Type Field Description private ClientSessionContextclientSessionContextClient session cache.private static DefaultSSLContextImpldefaultSslContextImplThe default SSLContextImpl for use with SSLContext.getInstance("Default").private java.lang.String[]protocolsTLS protocols to enable by default.private ServerSessionContextserverSessionContextServer session cache.(package private) SSLParametersImplsslParameters
-
Constructor Summary
Constructors Constructor Description OpenSSLContextImpl(java.lang.String[] protocols)OpenSSLContextImpl(java.lang.String[] protocols, boolean unused)Constuctor for the DefaultSSLContextImpl.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.net.ssl.SSLEngineengineCreateSSLEngine()javax.net.ssl.SSLEngineengineCreateSSLEngine(java.lang.String host, int port)javax.net.ssl.SSLSessionContextengineGetClientSessionContext()javax.net.ssl.SSLSessionContextengineGetServerSessionContext()javax.net.ssl.SSLServerSocketFactoryengineGetServerSocketFactory()javax.net.ssl.SSLSocketFactoryengineGetSocketFactory()voidengineInit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr)Initializes thisSSLContextinstance.(package private) static OpenSSLContextImplgetPreferred()Allows outside callers to get the preferred SSLContext.
-
-
-
Field Detail
-
defaultSslContextImpl
private static DefaultSSLContextImpl defaultSslContextImpl
The default SSLContextImpl for use with SSLContext.getInstance("Default"). Protected by the DefaultSSLContextImpl.class monitor.
-
protocols
private final java.lang.String[] protocols
TLS protocols to enable by default.
-
clientSessionContext
private final ClientSessionContext clientSessionContext
Client session cache.
-
serverSessionContext
private final ServerSessionContext serverSessionContext
Server session cache.
-
sslParameters
SSLParametersImpl sslParameters
-
-
Constructor Detail
-
OpenSSLContextImpl
OpenSSLContextImpl(java.lang.String[] protocols)
-
OpenSSLContextImpl
OpenSSLContextImpl(java.lang.String[] protocols, boolean unused) throws java.security.GeneralSecurityException, java.io.IOExceptionConstuctor for the DefaultSSLContextImpl. The unused boolean parameter is solely to indicate that this constructor is desired.- Throws:
java.security.GeneralSecurityExceptionjava.io.IOException
-
-
Method Detail
-
getPreferred
static OpenSSLContextImpl getPreferred()
Allows outside callers to get the preferred SSLContext.
-
engineInit
public void engineInit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr) throws java.security.KeyManagementExceptionInitializes thisSSLContextinstance. All of the arguments are optional, and the security providers will be searched for the required implementations of the needed algorithms.- Specified by:
engineInitin classjavax.net.ssl.SSLContextSpi- Parameters:
kms- the key sources ornulltms- the trust decision sources ornullsr- the randomness source ornull- Throws:
java.security.KeyManagementException- if initializing this instance fails
-
engineGetSocketFactory
public javax.net.ssl.SSLSocketFactory engineGetSocketFactory()
- Specified by:
engineGetSocketFactoryin classjavax.net.ssl.SSLContextSpi
-
engineGetServerSocketFactory
public javax.net.ssl.SSLServerSocketFactory engineGetServerSocketFactory()
- Specified by:
engineGetServerSocketFactoryin classjavax.net.ssl.SSLContextSpi
-
engineCreateSSLEngine
public javax.net.ssl.SSLEngine engineCreateSSLEngine(java.lang.String host, int port)- Specified by:
engineCreateSSLEnginein classjavax.net.ssl.SSLContextSpi
-
engineCreateSSLEngine
public javax.net.ssl.SSLEngine engineCreateSSLEngine()
- Specified by:
engineCreateSSLEnginein classjavax.net.ssl.SSLContextSpi
-
engineGetServerSessionContext
public javax.net.ssl.SSLSessionContext engineGetServerSessionContext()
- Specified by:
engineGetServerSessionContextin classjavax.net.ssl.SSLContextSpi
-
engineGetClientSessionContext
public javax.net.ssl.SSLSessionContext engineGetClientSessionContext()
- Specified by:
engineGetClientSessionContextin classjavax.net.ssl.SSLContextSpi
-
-