public class ReferenceCountedOpenSslEngine extends SSLEngine implements io.netty.util.ReferenceCounted
SSLEngine
using
OpenSSL BIO abstractions.
Instances of this class must be released
or else native memory will leak!
Instances of this class must be released before the ReferenceCountedOpenSslContext
the instance depends upon are released. Otherwise if any method of this class is called which uses the
the ReferenceCountedOpenSslContext
JNI resources the JVM may crash.
Modifier and Type | Method and Description |
---|---|
void |
beginHandshake() |
void |
closeInbound() |
void |
closeOutbound() |
String |
getApplicationProtocol() |
Runnable |
getDelegatedTask() |
String[] |
getEnabledCipherSuites() |
String[] |
getEnabledProtocols() |
boolean |
getEnableSessionCreation() |
String |
getHandshakeApplicationProtocol() |
SSLSession |
getHandshakeSession() |
SSLEngineResult.HandshakeStatus |
getHandshakeStatus() |
boolean |
getNeedClientAuth() |
String |
getNegotiatedApplicationProtocol()
Returns the name of the negotiated application-level protocol.
|
byte[] |
getOcspResponse()
Returns the OCSP response or
null if the server didn't provide a stapled OCSP response. |
SSLSession |
getSession() |
SSLParameters |
getSSLParameters() |
String[] |
getSupportedCipherSuites() |
String[] |
getSupportedProtocols() |
boolean |
getUseClientMode() |
boolean |
getWantClientAuth() |
boolean |
isInboundDone() |
boolean |
isOutboundDone() |
int |
refCnt() |
boolean |
release() |
boolean |
release(int decrement) |
io.netty.util.ReferenceCounted |
retain() |
io.netty.util.ReferenceCounted |
retain(int increment) |
void |
setEnabledCipherSuites(String[] cipherSuites) |
void |
setEnabledProtocols(String[] protocols)
TLS doesn't support a way to advertise non-contiguous versions from the client's perspective, and the client
just advertises the max supported version.
|
void |
setEnableSessionCreation(boolean b) |
void |
setNeedClientAuth(boolean b) |
void |
setOcspResponse(byte[] response)
Sets the OCSP response.
|
void |
setSSLParameters(SSLParameters sslParameters) |
void |
setUseClientMode(boolean clientMode) |
void |
setVerify(int verifyMode,
int depth)
See SSL_set_verify and
SSL.setVerify(long, int, int) . |
void |
setWantClientAuth(boolean b) |
void |
shutdown()
Destroys this engine.
|
long |
sslPointer()
Returns the pointer to the
SSL object for this ReferenceCountedOpenSslEngine . |
io.netty.util.ReferenceCounted |
touch() |
io.netty.util.ReferenceCounted |
touch(Object hint) |
SSLEngineResult |
unwrap(ByteBuffer[] srcs,
ByteBuffer[] dsts) |
SSLEngineResult |
unwrap(ByteBuffer[] srcs,
int srcsOffset,
int srcsLength,
ByteBuffer[] dsts,
int dstsOffset,
int dstsLength) |
SSLEngineResult |
unwrap(ByteBuffer src,
ByteBuffer dst) |
SSLEngineResult |
unwrap(ByteBuffer src,
ByteBuffer[] dsts) |
SSLEngineResult |
unwrap(ByteBuffer src,
ByteBuffer[] dsts,
int offset,
int length) |
SSLEngineResult |
wrap(ByteBuffer[] srcs,
int offset,
int length,
ByteBuffer dst) |
SSLEngineResult |
wrap(ByteBuffer src,
ByteBuffer dst) |
getHandshakeApplicationProtocolSelector, getPeerHost, getPeerPort, setHandshakeApplicationProtocolSelector, wrap
@UnstableApi public void setOcspResponse(byte[] response)
@UnstableApi public byte[] getOcspResponse()
null
if the server didn't provide a stapled OCSP response.public final int refCnt()
refCnt
in interface io.netty.util.ReferenceCounted
public final io.netty.util.ReferenceCounted retain()
retain
in interface io.netty.util.ReferenceCounted
public final io.netty.util.ReferenceCounted retain(int increment)
retain
in interface io.netty.util.ReferenceCounted
public final io.netty.util.ReferenceCounted touch()
touch
in interface io.netty.util.ReferenceCounted
public final io.netty.util.ReferenceCounted touch(Object hint)
touch
in interface io.netty.util.ReferenceCounted
public final boolean release()
release
in interface io.netty.util.ReferenceCounted
public final boolean release(int decrement)
release
in interface io.netty.util.ReferenceCounted
public String getApplicationProtocol()
getApplicationProtocol
in class SSLEngine
public String getHandshakeApplicationProtocol()
getHandshakeApplicationProtocol
in class SSLEngine
public final SSLSession getHandshakeSession()
getHandshakeSession
in class SSLEngine
public final long sslPointer()
SSL
object for this ReferenceCountedOpenSslEngine
.
Be aware that it is freed as soon as the release()
or shutdown()
methods are called.
At this point 0
will be returned.public final void shutdown()
public final SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst) throws SSLException
wrap
in class SSLEngine
SSLException
public final SSLEngineResult unwrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws SSLException
SSLException
public final SSLEngineResult unwrap(ByteBuffer[] srcs, ByteBuffer[] dsts) throws SSLException
SSLException
public final SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length) throws SSLException
unwrap
in class SSLEngine
SSLException
public final SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException
wrap
in class SSLEngine
SSLException
public final SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException
unwrap
in class SSLEngine
SSLException
public final SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts) throws SSLException
unwrap
in class SSLEngine
SSLException
public final Runnable getDelegatedTask()
getDelegatedTask
in class SSLEngine
public final void closeInbound() throws SSLException
closeInbound
in class SSLEngine
SSLException
public final boolean isInboundDone()
isInboundDone
in class SSLEngine
public final void closeOutbound()
closeOutbound
in class SSLEngine
public final boolean isOutboundDone()
isOutboundDone
in class SSLEngine
public final String[] getSupportedCipherSuites()
getSupportedCipherSuites
in class SSLEngine
public final String[] getEnabledCipherSuites()
getEnabledCipherSuites
in class SSLEngine
public final void setEnabledCipherSuites(String[] cipherSuites)
setEnabledCipherSuites
in class SSLEngine
public final String[] getSupportedProtocols()
getSupportedProtocols
in class SSLEngine
public final String[] getEnabledProtocols()
getEnabledProtocols
in class SSLEngine
public final void setEnabledProtocols(String[] protocols)
setEnabledProtocols
in class SSLEngine
public final SSLSession getSession()
getSession
in class SSLEngine
public final void beginHandshake() throws SSLException
beginHandshake
in class SSLEngine
SSLException
public final SSLEngineResult.HandshakeStatus getHandshakeStatus()
getHandshakeStatus
in class SSLEngine
public final void setUseClientMode(boolean clientMode)
setUseClientMode
in class SSLEngine
public final boolean getUseClientMode()
getUseClientMode
in class SSLEngine
public final void setNeedClientAuth(boolean b)
setNeedClientAuth
in class SSLEngine
public final boolean getNeedClientAuth()
getNeedClientAuth
in class SSLEngine
public final void setWantClientAuth(boolean b)
setWantClientAuth
in class SSLEngine
public final boolean getWantClientAuth()
getWantClientAuth
in class SSLEngine
@UnstableApi public final void setVerify(int verifyMode, int depth)
SSL.setVerify(long, int, int)
.public final void setEnableSessionCreation(boolean b)
setEnableSessionCreation
in class SSLEngine
public final boolean getEnableSessionCreation()
getEnableSessionCreation
in class SSLEngine
public final SSLParameters getSSLParameters()
getSSLParameters
in class SSLEngine
public final void setSSLParameters(SSLParameters sslParameters)
setSSLParameters
in class SSLEngine
public String getNegotiatedApplicationProtocol()
null
if the negotiation failed or the client does not have ALPN/NPN extensionCopyright © 2008–2023 The Netty Project. All rights reserved.