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 | Class and Description |
|---|---|
| private class | |
| private class | |
| private static enum | |
| private static interface | |
| private static class | |
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private Object | |
| pack-priv final ByteBufAllocator | |
| private final OpenSslApplicationProtocolNegotiator | apn
Deprecated
as a consequence of
OpenSslApplicationProtocolNegotiator being deprecated.
|
| private volatile String | |
| private volatile ClientAuth | |
| private final boolean | |
| private static final SSLEngineResult | |
| private volatile boolean | |
| private final boolean | |
| private String | |
| private final OpenSslEngineMap | |
| private String[] | |
| private ReferenceCountedOpenSslEngine. | |
| private boolean | |
| private static final X509Certificate[] | JAVAX_CERTS_NOT_SUPPORTED
Deprecated
as a consequence of
X509Certificate being deprecated.
|
| pack-priv final boolean | |
| private final ResourceLeakTracker | |
| private static final ResourceLeakDetector | |
| private static final InternalLogger | |
| private volatile Collection | |
| pack-priv static final int | MAX_PLAINTEXT_LENGTH
Depends upon tcnative ... |
| pack-priv static final int | MAX_RECORD_SIZE
Depends upon tcnative ... |
| private int | |
| private int | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private static final SSLEngineResult | |
| private volatile boolean | |
| private long | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int[] | |
| private boolean | |
| private final ReferenceCountedOpenSslContext | |
| private Throwable | |
| private boolean | |
| private final AbstractReferenceCounted | |
| private final OpenSslSession | |
| private boolean | |
| private final ByteBuffer[] | |
| private final ByteBuffer[] | |
| private List | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv | ReferenceCountedOpenSslEngine(ReferenceCountedOpenSslContext
Reference count release responsibility is not transferred! The callee still owns this object. context, final ByteBufAllocator The allocator to use. alloc, String The peer host name. peerHost, int The peer port. peerPort, boolean true to behave like described in
https://docs.oracle.com/javase/7/docs/api/javax/net/ssl/SSLEngine.html.
false allows for partial and/or multiple packets to be process in a single
wrap or unwrap call.true to enable leak detection of this object.Create a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final synchronized String[] | |
| public final synchronized void | beginHandshake()
Implements abstract javax. |
| pack-priv synchronized void | |
| private static long | |
| pack-priv final int | calculateMaxLengthForWrap(int plaintextLength, int numComponents)
This method is intentionally not synchronized, only use if you know you are in the EventLoop
thread and visibility on |
| private void | calculateMaxWrapOverhead()
It is assumed this method is called in a synchronized block (or the constructor)! |
| pack-priv final int | calculateOutNetBufSize(int plaintextLength, int numComponents)
This method is intentionally not synchronized, only use if you know you are in the EventLoop
thread and visibility on |
| private void | |
| pack-priv final boolean | |
| private void | |
| public final synchronized void | closeInbound()
Implements abstract javax. SSLEngine.
|
| public final synchronized void | closeOutbound()
Implements abstract javax. SSLEngine.
|
| private boolean | |
| public String | getApplicationProtocol()
Returns the most recent application protocol value negotiated for this
connection.
|
| public final synchronized Runnable | getDelegatedTask()
Implements abstract javax. Runnable task for
this SSLEngine.
|
| public final String[] | getEnabledCipherSuites()
Implements abstract javax. |
| public final String[] | getEnabledProtocols()
Implements abstract javax. SSLEngine.
|
| public final boolean | getEnableSessionCreation()
Implements abstract javax. |
| public String | getHandshakeApplicationProtocol()
Overrides javax. |
| public final synchronized SSLSession | getHandshakeSession()
Overrides javax. SSLSession being constructed during a SSL/TLS/DTLS
handshake.
|
| public final synchronized SSLEngineResult. | getHandshakeStatus()
Implements abstract javax. SSLEngine.
|
| private SSLEngineResult. | |
| public final boolean | getNeedClientAuth()
Implements abstract javax. |
| public String | getNegotiatedApplicationProtocol()
Implements io. |
| public byte[] | getOcspResponse()
Returns the OCSP response or |
| public final SSLSession | getSession()
Implements abstract javax. SSLSession in use in this
SSLEngine.
|
| public final synchronized SSLParameters | getSSLParameters()
Overrides javax. |
| public final String[] | getSupportedCipherSuites()
Implements abstract javax. |
| public final String[] | getSupportedProtocols()
Implements abstract javax. SSLEngine.
|
| public final boolean | getUseClientMode()
Implements abstract javax. |
| public final boolean | getWantClientAuth()
Implements abstract javax. |
| private SSLEngineResult | |
| private SSLEngineResult. | |
| private SSLEngineResult. | |
| pack-priv final void | initHandshakeException(Throwable cause)
Should be called if the handshake will be failed due a callback that throws an exception. |
| private boolean | |
| private boolean | |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| public final synchronized boolean | isInboundDone()
Implements abstract javax. unwrap(ByteBuffer, ByteBuffer) will
accept any more inbound data messages.
|
| public final synchronized boolean | isOutboundDone()
Implements abstract javax. wrap(ByteBuffer, ByteBuffer) will
produce any more outbound data messages.
|
| private static boolean | |
| pack-priv synchronized boolean | |
| pack-priv final synchronized SecretKeySpec | |
| pack-priv final synchronized int | |
| pack-priv final int | maxEncryptedPacketLength0()
This method is intentionally not synchronized, only use if you know you are in the EventLoop
thread and visibility on |
| pack-priv final synchronized int | |
| private SSLEngineResult. | |
| private SSLEngineResult. | |
| private boolean | |
| private boolean | |
| private SSLEngineResult | |
| private SSLEngineResult | newResult(SSLEngineResult.
|
| private SSLEngineResult | newResultMayFinishHandshake(SSLEngineResult.
|
| private SSLEngineResult | newResultMayFinishHandshake(SSLEngineResult.
|
| private SSLException | |
| private static SSLEngineResult. | |
| private int | |
| public final int | refCnt()
Implements io. |
| private void | |
| public final boolean | release()
Implements io. 1 and deallocates this object if the reference count reaches at
0.
|
| public final boolean | release(int decrement)
Implements io. decrement and deallocates this object if the reference
count reaches at 0.
|
| private void | |
| private void | |
| public final ReferenceCounted | |
| public final ReferenceCounted | retain(int increment)
Implements io. increment.
|
| private synchronized void | |
| private void | |
| private String | selectApplicationProtocol(List<String> protocols, ApplicationProtocolConfig.
|
| private void | |
| public final void | setEnabledCipherSuites(String[]
Names of all the cipher suites to enable cipherSuites)Implements abstract javax. |
| public final void | setEnabledProtocols(String[]
Names of all the protocols to enable. protocols)Implements abstract javax. |
| private void | |
| public final void | setEnableSessionCreation(boolean
true indicates that sessions may be created; this
is the default. false indicates that an existing session
must be resumed b)Implements abstract javax. |
| pack-priv final boolean | |
| public final void | setNeedClientAuth(boolean
set to true if client authentication is required,
or false if no client authentication is desired. b)Implements abstract javax. |
| public void | |
| public final synchronized void | setSSLParameters(SSLParameters
the parameters sslParameters)Overrides javax. |
| public final void | setUseClientMode(boolean
true if the engine should start its handshaking
in "client" mode clientMode)Implements abstract javax. |
| public final synchronized void | |
| public final void | setWantClientAuth(boolean
set to true if client authentication is requested,
or false if no client authentication is desired. b)Implements abstract javax. |
| private static boolean | |
| public final synchronized void | |
| private SSLException | shutdownWithError(String operations, int sslError)
Log the error, shutdown the engine and throw an exception. |
| private SSLException | |
| private ByteBuffer[] | |
| private ByteBuffer[] | |
| pack-priv final synchronized int | |
| private int | |
| public final synchronized long | |
| private SSLEngineResult | |
| private String | toJavaCipherSuite(String openSslCipherSuite)
Converts the specified OpenSSL cipher suite to the Java cipher suite. |
| private static String | toJavaCipherSuitePrefix(String protocolVersion)
Converts the protocol version string returned by |
| public final ReferenceCounted | touch()
Implements io. |
| public final ReferenceCounted | touch(Object hint)
Implements io. |
| public final SSLEngineResult | unwrap(final ByteBuffer[] srcs, int srcsOffset, final int srcsLength, final ByteBuffer[] dsts, int dstsOffset, final int dstsLength)
|
| public final SSLEngineResult | |
| public final synchronized SSLEngineResult | unwrap(final ByteBuffer
a src, final ByteBuffer[] ByteBuffer containing inbound network data.an array of dsts, final int ByteBuffers to hold inbound
application data.The offset within the buffer array of the first buffer from
which bytes are to be transferred; it must be non-negative
and no larger than offset, final int dsts.length.The maximum number of buffers to be accessed; it must be
non-negative and no larger than
length)dsts.length - offset.Implements abstract javax. |
| public final synchronized SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing inbound network data.a dst)ByteBuffer to hold inbound application data.Overrides javax. |
| public final synchronized SSLEngineResult | unwrap(ByteBuffer
a src, ByteBuffer[] ByteBuffer containing inbound network data.an array of dsts)ByteBuffers to hold inbound
application data.Overrides javax. |
| public final SSLEngineResult | wrap(final ByteBuffer[]
an array of srcs, int ByteBuffers containing the
outbound application dataThe offset within the buffer array of the first buffer from
which bytes are to be retrieved; it must be non-negative
and no larger than offset, final int srcs.lengthThe maximum number of buffers to be accessed; it must be
non-negative and no larger than
length, final ByteBuffer srcs.length - offseta dst)ByteBuffer to hold outbound network dataImplements abstract javax. |
| public final synchronized SSLEngineResult | wrap(ByteBuffer
a src, ByteBuffer ByteBuffer containing outbound application dataa dst)ByteBuffer to hold outbound network dataOverrides javax. |
| private ByteBuf | |
| private int | writePlaintextData(final ByteBuffer src, int len)
Write plaintext data to the OpenSSL internal BIO Calling this function with src.remaining == 0 is undefined. |