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 class
OpenSSLContextImpl.TLSv1
Public to allow construction via the provider framework.static class
OpenSSLContextImpl.TLSv11
Public to allow construction via the provider framework.static class
OpenSSLContextImpl.TLSv12
Public to allow construction via the provider framework.static class
OpenSSLContextImpl.TLSv13
Public to allow construction via the provider framework.
-
Field Summary
Fields Modifier and Type Field Description private ClientSessionContext
clientSessionContext
Client session cache.private static DefaultSSLContextImpl
defaultSslContextImpl
The default SSLContextImpl for use with SSLContext.getInstance("Default").private java.lang.String[]
protocols
TLS protocols to enable by default.private ServerSessionContext
serverSessionContext
Server session cache.(package private) SSLParametersImpl
sslParameters
-
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.SSLEngine
engineCreateSSLEngine()
javax.net.ssl.SSLEngine
engineCreateSSLEngine(java.lang.String host, int port)
javax.net.ssl.SSLSessionContext
engineGetClientSessionContext()
javax.net.ssl.SSLSessionContext
engineGetServerSessionContext()
javax.net.ssl.SSLServerSocketFactory
engineGetServerSocketFactory()
javax.net.ssl.SSLSocketFactory
engineGetSocketFactory()
void
engineInit(javax.net.ssl.KeyManager[] kms, javax.net.ssl.TrustManager[] tms, java.security.SecureRandom sr)
Initializes thisSSLContext
instance.(package private) static OpenSSLContextImpl
getPreferred()
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.IOException
Constuctor for the DefaultSSLContextImpl. The unused boolean parameter is solely to indicate that this constructor is desired.- Throws:
java.security.GeneralSecurityException
java.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.KeyManagementException
Initializes thisSSLContext
instance. All of the arguments are optional, and the security providers will be searched for the required implementations of the needed algorithms.- Specified by:
engineInit
in classjavax.net.ssl.SSLContextSpi
- Parameters:
kms
- the key sources ornull
tms
- the trust decision sources ornull
sr
- the randomness source ornull
- Throws:
java.security.KeyManagementException
- if initializing this instance fails
-
engineGetSocketFactory
public javax.net.ssl.SSLSocketFactory engineGetSocketFactory()
- Specified by:
engineGetSocketFactory
in classjavax.net.ssl.SSLContextSpi
-
engineGetServerSocketFactory
public javax.net.ssl.SSLServerSocketFactory engineGetServerSocketFactory()
- Specified by:
engineGetServerSocketFactory
in classjavax.net.ssl.SSLContextSpi
-
engineCreateSSLEngine
public javax.net.ssl.SSLEngine engineCreateSSLEngine(java.lang.String host, int port)
- Specified by:
engineCreateSSLEngine
in classjavax.net.ssl.SSLContextSpi
-
engineCreateSSLEngine
public javax.net.ssl.SSLEngine engineCreateSSLEngine()
- Specified by:
engineCreateSSLEngine
in classjavax.net.ssl.SSLContextSpi
-
engineGetServerSessionContext
public javax.net.ssl.SSLSessionContext engineGetServerSessionContext()
- Specified by:
engineGetServerSessionContext
in classjavax.net.ssl.SSLContextSpi
-
engineGetClientSessionContext
public javax.net.ssl.SSLSessionContext engineGetClientSessionContext()
- Specified by:
engineGetClientSessionContext
in classjavax.net.ssl.SSLContextSpi
-
-