public abstract class ReferenceCountedOpenSslContext extends SslContext implements io.netty.util.ReferenceCounted
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.
| Modifier and Type | Field and Description |
|---|---|
protected long |
ctx
The OpenSSL SSL_CTX object.
|
protected static int |
VERIFY_DEPTH |
| Modifier and Type | Method and Description |
|---|---|
ApplicationProtocolNegotiator |
applicationProtocolNegotiator()
Returns the object responsible for negotiating application layer protocols for the TLS NPN/ALPN extensions.
|
protected static X509Certificate[] |
certificates(byte[][] chain) |
protected static X509TrustManager |
chooseTrustManager(TrustManager[] managers) |
protected static X509KeyManager |
chooseX509KeyManager(KeyManager[] kms) |
List<String> |
cipherSuites()
Returns the list of enabled cipher suites, in the order of preference.
|
long |
context()
Deprecated.
this method is considered unsafe as the returned pointer may be released later. Dont use it!
|
int |
getBioNonApplicationBufferSize()
Returns the size of the buffer used by the BIO for non-application based writes
|
boolean |
getRejectRemoteInitiatedRenegotiation()
Deprecated.
|
boolean |
isClient()
Returns the
true if and only if this context is for client-side. |
SSLEngine |
newEngine(io.netty.buffer.ByteBufAllocator alloc)
Returns a new server-side
SSLEngine with the current configuration. |
SSLEngine |
newEngine(io.netty.buffer.ByteBufAllocator alloc,
String peerHost,
int peerPort)
Creates a new
SSLEngine using advisory peer information. |
protected SslHandler |
newHandler(io.netty.buffer.ByteBufAllocator alloc,
boolean startTls)
Create a new SslHandler.
|
protected SslHandler |
newHandler(io.netty.buffer.ByteBufAllocator alloc,
String peerHost,
int peerPort,
boolean startTls)
Create a new SslHandler.
|
int |
refCnt() |
boolean |
release() |
boolean |
release(int decrement) |
io.netty.util.ReferenceCounted |
retain() |
io.netty.util.ReferenceCounted |
retain(int increment) |
long |
sessionCacheSize()
Returns the size of the cache used for storing SSL session objects.
|
abstract OpenSslSessionContext |
sessionContext()
Returns the
SSLSessionContext object held by this context. |
long |
sessionTimeout()
Returns the timeout for the cached SSL session objects, in seconds.
|
void |
setBioNonApplicationBufferSize(int bioNonApplicationBufferSize)
Set the size of the buffer used by the BIO for non-application based writes
(e.g. handshake, renegotiation, etc...).
|
void |
setRejectRemoteInitiatedRenegotiation(boolean rejectRemoteInitiatedRenegotiation)
Deprecated.
|
void |
setTicketKeys(byte[] keys)
Deprecated.
|
long |
sslCtxPointer()
Deprecated.
this method is considered unsafe as the returned pointer may be released later. Dont use it!
|
OpenSslSessionStats |
stats()
Deprecated.
use
#sessionContext#stats() |
io.netty.util.ReferenceCounted |
touch() |
io.netty.util.ReferenceCounted |
touch(Object hint) |
buildTrustManagerFactory, defaultClientProvider, defaultServerProvider, generateKeySpec, isServer, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newClientContext, newHandler, newHandler, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, newServerContext, nextProtocolsprotected static final int VERIFY_DEPTH
protected long ctx
ctxLock must be hold while using ctx!public final List<String> cipherSuites()
SslContextcipherSuites in class SslContextpublic final long sessionCacheSize()
SslContextsessionCacheSize in class SslContextpublic final long sessionTimeout()
SslContextsessionTimeout in class SslContextpublic ApplicationProtocolNegotiator applicationProtocolNegotiator()
SslContextapplicationProtocolNegotiator in class SslContextpublic final boolean isClient()
SslContexttrue if and only if this context is for client-side.isClient in class SslContextpublic final SSLEngine newEngine(io.netty.buffer.ByteBufAllocator alloc, String peerHost, int peerPort)
SslContextSSLEngine using advisory peer information.
If SslProvider.OPENSSL_REFCNT is used then the object must be released. One way to do this is to
wrap in a SslHandler and insert it into a pipeline.
See SslContext.newHandler(ByteBufAllocator, String, int).
newEngine in class SslContextpeerHost - the non-authoritative name of the hostpeerPort - the non-authoritative portSSLEngineprotected final SslHandler newHandler(io.netty.buffer.ByteBufAllocator alloc, boolean startTls)
SslContextnewHandler in class SslContextSslContext.newHandler(ByteBufAllocator)protected final SslHandler newHandler(io.netty.buffer.ByteBufAllocator alloc, String peerHost, int peerPort, boolean startTls)
SslContextnewHandler in class SslContextSslContext.newHandler(ByteBufAllocator, String, int, boolean)public final SSLEngine newEngine(io.netty.buffer.ByteBufAllocator alloc)
SSLEngine with the current configuration.newEngine in class SslContextSSLEngine@Deprecated public final long context()
SSL_CTX object for this ReferenceCountedOpenSslContext.
Be aware that it is freed as soon as the Object.finalize() method is called.
At this point 0 will be returned.@Deprecated public final OpenSslSessionStats stats()
#sessionContext#stats()@Deprecated public void setRejectRemoteInitiatedRenegotiation(boolean rejectRemoteInitiatedRenegotiation)
SSLHandshakeException will be thrown during decoding.@Deprecated public boolean getRejectRemoteInitiatedRenegotiation()
true because renegotiation is not supported.public void setBioNonApplicationBufferSize(int bioNonApplicationBufferSize)
public int getBioNonApplicationBufferSize()
@Deprecated public final void setTicketKeys(byte[] keys)
OpenSslSessionContext.setTicketKeys(byte[])public abstract OpenSslSessionContext sessionContext()
SslContextSSLSessionContext object held by this context.sessionContext in class SslContext@Deprecated public final long sslCtxPointer()
SSL_CTX object for this ReferenceCountedOpenSslContext.
Be aware that it is freed as soon as the release() method is called.
At this point 0 will be returned.protected static X509Certificate[] certificates(byte[][] chain)
protected static X509TrustManager chooseTrustManager(TrustManager[] managers)
protected static X509KeyManager chooseX509KeyManager(KeyManager[] kms)
public final int refCnt()
refCnt in interface io.netty.util.ReferenceCountedpublic final io.netty.util.ReferenceCounted retain()
retain in interface io.netty.util.ReferenceCountedpublic final io.netty.util.ReferenceCounted retain(int increment)
retain in interface io.netty.util.ReferenceCountedpublic final io.netty.util.ReferenceCounted touch()
touch in interface io.netty.util.ReferenceCountedpublic final io.netty.util.ReferenceCounted touch(Object hint)
touch in interface io.netty.util.ReferenceCountedpublic final boolean release()
release in interface io.netty.util.ReferenceCountedpublic final boolean release(int decrement)
release in interface io.netty.util.ReferenceCountedCopyright © 2008–2019 The Netty Project. All rights reserved.