Top Description Inners Fields Constructors Methods
io.netty5.handler.ssl

public abstract Class ReferenceCountedOpenSslContext

extends SslContext
implements ReferenceCounted
Class Inheritance
All Implemented Interfaces
io.netty5.util.ReferenceCounted
Known Direct Subclasses
io.netty5.handler.ssl.ReferenceCountedOpenSslServerContext, io.netty5.handler.ssl.OpenSslContext, io.netty5.handler.ssl.ReferenceCountedOpenSslClientContext
Imports
io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod, .CertificateCompressionAlgo, .CertificateVerifier, .ResultCallback, .SSL, .SSLContext, .SSLPrivateKeyMethod, io.netty5.buffer.Buffer, .BufferAllocator, .SensitiveBufferAllocator, io.netty5.handler.ssl.util.LazyX509Certificate, io.netty5.util.AbstractReferenceCounted, .ReferenceCounted, .ResourceLeakDetector, .ResourceLeakDetectorFactory, .ResourceLeakTracker, io.netty5.util.concurrent.Future, .FutureListener, io.netty5.util.internal.EmptyArrays, .StringUtil, .SystemPropertyUtil, .UnstableApi, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory, javax.net.ssl.KeyManager, .KeyManagerFactory, .SSLEngine, .SSLException, .SSLHandshakeException, .TrustManager, .X509ExtendedTrustManager, .X509KeyManager, .X509TrustManager, java.security.PrivateKey, .SignatureException, java.security.cert.CertPathValidatorException, .Certificate, .CertificateExpiredException, .CertificateNotYetValidException, .CertificateRevokedException, .X509Certificate, java.util.ArrayList, .Collections, .LinkedHashSet, .List, .Map, java.util.concurrent.ConcurrentHashMap, .Executor, java.util.concurrent.locks.Lock, .ReadWriteLock, .ReentrantReadWriteLock

An implementation of SslContext which works with libraries that support the OpenSsl C library API.

Instances of this class must be released or else native memory will leak!

Instances of this class must not be released before any ReferenceCountedOpenSslEngine which depends upon the instance of this class is released. Otherwise if any method of ReferenceCountedOpenSslEngine is called which uses this class's JNI resources the JVM may crash.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final OpenSslApplicationProtocolNegotiator
apn

Deprecated as a consequence of OpenSslApplicationProtocolNegotiator being deprecated.
private volatile int
pack-priv static final boolean
pack-priv static final boolean
pack-priv static final boolean
pack-priv final ClientAuth
protected long
ctx

The OpenSSL SSL_CTX object.

pack-priv final ReadWriteLock
private static final int
private static final Integer
pack-priv final boolean
pack-priv final OpenSslEngineMap
pack-priv final Certificate[]
private final ResourceLeakTracker<ReferenceCountedOpenSslContext>
private static final ResourceLeakDetector<ReferenceCountedOpenSslContext>
private static final InternalLogger
private final int
pack-priv static final OpenSslApplicationProtocolNegotiator
NONE_PROTOCOL_NEGOTIATOR

Deprecated as a consequence of OpenSslApplicationProtocolNegotiator being deprecated.
pack-priv final String[]
private final AbstractReferenceCounted
pack-priv static final boolean
pack-priv static final boolean
pack-priv static final boolean
pack-priv final boolean
private final List<String>
pack-priv static final boolean
protected static final int
Inherited from io.netty5.handler.ssl.SslContext:
ALIASX509_CERT_FACTORY

Constructor Summary

AccessConstructor and Description
pack-priv
ReferenceCountedOpenSslContext(Iterable<String> ciphers, CipherSuiteFilter cipherFilter, OpenSslApplicationProtocolNegotiator apn, int mode, Certificate[] keyCertChain, ClientAuth clientAuth, String[] protocols, boolean startTls, boolean enableOcsp, boolean leakDetection, Map.Entry<SslContextOption<?>, Object>... ctxOptions)

Deprecated as a consequence of OpenSslApplicationProtocolNegotiator being deprecated.

Method Summary

Modifier and TypeMethod and Description
public ApplicationProtocolNegotiator
applicationProtocolNegotiator()

Implements abstract io.netty5.handler.ssl.SslContext.applicationProtocolNegotiator.

Deprecated as a consequence of ApplicationProtocolNegotiator being deprecated.
Returns the object responsible for negotiating application layer protocols for the TLS NPN/ALPN extensions.
protected static X509Certificate[]
certificates(byte[][] chain)

protected static X509TrustManager
protected static X509KeyManager
public final List<String>
cipherSuites()

Implements abstract io.netty5.handler.ssl.SslContext.cipherSuites.

Returns the list of enabled cipher suites, in the order of preference.
public final long
context()

Deprecated this method is considered unsafe as the returned pointer may be released later. Dont use it!
Returns the pointer to the SSL_CTX object for this ReferenceCountedOpenSslContext.
private void
pack-priv static void
freeBio(long bio)

public int
getBioNonApplicationBufferSize()

Returns the size of the buffer used by the BIO for non-application based writes

public boolean

Returns:

true because renegotiation is not supported.
getRejectRemoteInitiatedRenegotiation
()

Deprecated
{@deprecated Renegotiation is not supported}
public final boolean
isClient()

Implements abstract io.netty5.handler.ssl.SslContext.isClient.

Returns the true if and only if this context is for client-side.
private static long

Returns:

The BIO address.
newBIO
(Buffer
The buffer to allocate a BIO for.
buffer
)

Allocate a BIO with a copy of the readable contents of the given buffer.

public final SSLEngine
newEngine(BufferAllocator alloc, String
the non-authoritative name of the host
peerHost
,
int
the non-authoritative port
peerPort
)

Implements abstract io.netty5.handler.ssl.SslContext.newEngine.

Creates a new SSLEngine using advisory peer information.
public final SSLEngine
newEngine(BufferAllocator alloc)

Implements abstract io.netty5.handler.ssl.SslContext.newEngine.

Returns a new server-side SSLEngine with the current configuration.
pack-priv SSLEngine
newEngine0(BufferAllocator alloc, String peerHost, int peerPort, boolean jdkCompatibilityMode)

protected final SslHandler
newHandler(BufferAllocator alloc, boolean startTls)

Overrides io.netty5.handler.ssl.SslContext.newHandler.

Create a new SslHandler.
protected final SslHandler
newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls)

Overrides io.netty5.handler.ssl.SslContext.newHandler.

Create a new SslHandler.
protected SslHandler
newHandler(BufferAllocator alloc, boolean startTls, Executor executor)

Overrides io.netty5.handler.ssl.SslContext.newHandler.

Create a new SslHandler.
protected SslHandler
newHandler(BufferAllocator alloc, String peerHost, int peerPort, boolean startTls, Executor executor)

Overrides io.netty5.handler.ssl.SslContext.newHandler.

private static int
pack-priv static OpenSslKeyMaterialProvider
providerFor(KeyManagerFactory factory, String password)

Returns the OpenSslKeyMaterialProvider that should be used for OpenSSL.

public final int
refCnt()

Implements io.netty5.util.ReferenceCounted.refCnt.

Returns the reference count of this object.
public final boolean
release()

Implements io.netty5.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
public final boolean
release(int decrement)

Implements io.netty5.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
public final ReferenceCounted
retain()

Implements io.netty5.util.ReferenceCounted.retain.

Increases the reference count by 1.
public final ReferenceCounted
retain(int increment)

Implements io.netty5.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
private static ReferenceCountedOpenSslEngine
retrieveEngine(OpenSslEngineMap engineMap, long ssl)

public abstract OpenSslSessionContext
sessionContext()

Implements abstract io.netty5.handler.ssl.SslContext.sessionContext.

Returns the SSLSessionContext object held by this context.
public void
setBioNonApplicationBufferSize(int bioNonApplicationBufferSize)

Set the size of the buffer used by the BIO for non-application based writes (e.g. handshake, renegotiation, etc...).

pack-priv static void
setKeyMaterial(long ctx, X509Certificate[] keyCertChain, PrivateKey key, String keyPassword)

public final void
public void
setRejectRemoteInitiatedRenegotiation(boolean rejectRemoteInitiatedRenegotiation)

Deprecated
{@deprecated Renegotiation is not supported} Specify if remote initiated renegotiation is supported or not.
public final void
setTicketKeys(byte[] keys)

Sets the SSL session ticket keys of this context.
public final void
public final long
sslCtxPointer()

Deprecated this method is considered unsafe as the returned pointer may be released later. Dont use it!
Returns the pointer to the SSL_CTX object for this ReferenceCountedOpenSslContext.
public final OpenSslSessionStats
stats()

Deprecated use sessionContext#stats()
Returns the stats of this context.
pack-priv static long
toBIO(PrivateKey key)

Return the pointer to a in-memory BIO or 0 if the key is null.

pack-priv static long
toBIO(BufferAllocator allocator, X509Certificate... certChain)

Return the pointer to a in-memory BIO or 0 if the certChain is null.

pack-priv static long
toBIO(BufferAllocator allocator, PemEncoded pem)

Copies the contents of the PemEncoded value into a new in-memory BIO, and returns the reference to the BIO, or 0 if the buffer is null.

pack-priv static OpenSslApplicationProtocolNegotiator

Returns:

The results of the translation
toNegotiator
(ApplicationProtocolConfig
The configuration which defines the translation
config
)

Deprecated as a consequence of OpenSslApplicationProtocolNegotiator being deprecated.
Translate a ApplicationProtocolConfig object to a OpenSslApplicationProtocolNegotiator object.
public final ReferenceCounted
touch()

Implements io.netty5.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes.
public final ReferenceCounted
touch(Object hint)

Implements io.netty5.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
pack-priv static boolean
private static byte[]
verifyResult(byte[] result)

Inherited from io.netty5.handler.ssl.SslContext:
attributesbuildKeyManagerFactorybuildKeyManagerFactorybuildKeyStorebuildTrustManagerFactorybuildTrustManagerFactorybuildTrustManagerFactorydefaultClientProviderdefaultServerProvidergenerateKeySpecisServerkeyStorePasswordnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextnewClientContextInternalnewHandlernewHandlernewHandlernewHandlernewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextnewServerContextInternalnextProtocolssessionCacheSizesessionTimeouttoApplicationProtocolConfigtoPrivateKeytoPrivateKeytoPrivateKeyInternaltoX509CertificatestoX509CertificatestoX509CertificatesInternal