Package io.netty.handler.ssl
Class ReferenceCountedOpenSslEngine
java.lang.Object
javax.net.ssl.SSLEngine
io.netty.handler.ssl.ReferenceCountedOpenSslEngine
- All Implemented Interfaces:
ApplicationProtocolAccessor
,ReferenceCounted
- Direct Known Subclasses:
OpenSslEngine
public class ReferenceCountedOpenSslEngine
extends SSLEngine
implements ReferenceCounted, ApplicationProtocolAccessor
Implements a
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class
private final class
private static enum
private static interface
private static final class
private static final class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
(package private) final ByteBufAllocator
private final OpenSslApplicationProtocolNegotiator
private String
private ClientAuth
private final boolean
private static final SSLEngineResult
private boolean
private final boolean
private String
private final OpenSslEngineMap
private boolean
private boolean
private static final X509Certificate[]
(package private) final boolean
private final ResourceLeakTracker
<ReferenceCountedOpenSslEngine> private static final ResourceLeakDetector
<ReferenceCountedOpenSslEngine> private static final InternalLogger
private Collection
<?> (package private) static final int
Depends upon tcnative ...(package private) static final int
Depends upon tcnative ...private int
private int
private static final SSLEngineResult
private static final SSLEngineResult
private static final SSLEngineResult
private static final SSLEngineResult
private 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 long
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceCountedOpenSslEngine
(ReferenceCountedOpenSslContext context, ByteBufAllocator alloc, String peerHost, int peerPort, boolean jdkCompatibilityMode, boolean leakDetection, String endpointIdentificationAlgorithm) Create a new instance. -
Method Summary
Modifier and TypeMethodDescription(package private) final String[]
final void
(package private) void
bioSetFd
(int fd) private static long
(package private) 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 onmaxWrapBufferSize
andmaxWrapOverhead
is achieved via other synchronized blocks.private void
It is assumed this method is called in a synchronized block (or the constructor)!(package private) 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 onmaxWrapOverhead
is achieved via other synchronized blocks.private void
(package private) final boolean
checkSniHostnameMatch
(byte[] hostname) private void
closeAll()
final void
final void
private void
configureEndpointVerification
(String endpointIdentificationAlgorithm) private boolean
Attempt to callSSL.shutdownSSL(long)
.final Runnable
final String[]
final String[]
final boolean
final SSLSession
private SSLEngineResult.HandshakeStatus
getHandshakeStatus
(int pending) final boolean
Returns the name of the negotiated application-level protocol.byte[]
Returns the OCSP response ornull
if the server didn't provide a stapled OCSP response.final SSLSession
final SSLParameters
final String[]
final String[]
final boolean
final boolean
private SSLEngineResult
handleUnwrapException
(int bytesConsumed, int bytesProduced, SSLException e) private SSLEngineResult.HandshakeStatus
private SSLEngineResult.HandshakeStatus
(package private) final void
initHandshakeException
(Throwable cause) Should be called if the handshake will be failed due a callback that throws an exception.private boolean
isBytesAvailableEnoughForWrap
(int bytesAvailable, int plaintextLength, int numComponents) private boolean
private static boolean
isEmpty
(byte[] cert) private static boolean
private static boolean
isEndPointVerificationEnabled
(String endPointIdentificationAlgorithm) final boolean
final boolean
private static boolean
isProtocolEnabled
(int opts, int disableMask, String protocolString) (package private) boolean
(package private) final SecretKeySpec
(package private) final int
Visible only for testing!(package private) final int
This method is intentionally not synchronized, only use if you know you are in the EventLoop thread and visibility onmaxWrapOverhead
is achieved via other synchronized blocks.(package private) final int
Visible only for testing!private SSLEngineResult.HandshakeStatus
private SSLEngineResult.HandshakeStatus
mayFinishHandshake
(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) private boolean
private boolean
needWrapAgain
(int stackError) private SSLEngineResult
newResult
(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) private SSLEngineResult
newResult
(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) private SSLEngineResult
newResultMayFinishHandshake
(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) private SSLEngineResult
newResultMayFinishHandshake
(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) private SSLException
newSSLExceptionForError
(int stackError) private static SSLEngineResult.HandshakeStatus
pendingStatus
(int pendingStatus) private int
Read plaintext data from the OpenSSL internal BIOfinal int
refCnt()
Returns the reference count of this object.private void
final boolean
release()
Decreases the reference count by1
and deallocates this object if the reference count reaches at0
.final boolean
release
(int decrement) Decreases the reference count by the specifieddecrement
and deallocates this object if the reference count reaches at0
.private void
private void
final ReferenceCounted
retain()
Increases the reference count by1
.final ReferenceCounted
retain
(int increment) Increases the reference count by the specifiedincrement
.private void
runAndResetNeedTask
(Runnable task) private void
Select the application protocol used.private String
selectApplicationProtocol
(List<String> protocols, ApplicationProtocolConfig.SelectedListenerFailureBehavior behavior, String applicationProtocol) private void
setClientAuth
(ClientAuth mode) final void
setEnabledCipherSuites
(String[] cipherSuites) final 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.private void
setEnabledProtocols0
(String[] protocols, boolean explicitDisableTLSv13) final void
setEnableSessionCreation
(boolean b) (package private) final boolean
setKeyMaterial
(OpenSslKeyMaterial keyMaterial) final void
setNeedClientAuth
(boolean b) void
setOcspResponse
(byte[] response) Sets the OCSP response.final void
setSSLParameters
(SSLParameters sslParameters) final void
setUseClientMode
(boolean clientMode) final void
setVerify
(int verifyMode, int depth) See SSL_set_verify andSSL.setVerify(long, int, int)
.final void
setWantClientAuth
(boolean b) private static boolean
shouldAddSuppressed
(Throwable target, int errorCode) final void
shutdown()
Destroys this engine.private SSLException
shutdownWithError
(String operation, int sslError, int error) Log the error, shutdown the engine and throw an exception.private ByteBuffer[]
private ByteBuffer[]
(package private) final int
private int
final long
Returns the pointer to theSSL
object for thisReferenceCountedOpenSslEngine
.private SSLEngineResult
sslReadErrorResult
(int error, int stackError, int bytesConsumed, int bytesProduced) 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 bySSL.getVersion(long)
to protocol family string.final ReferenceCounted
touch()
Records the current access location of this object for debugging purposes.final ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes.final SSLEngineResult
unwrap
(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength) final SSLEngineResult
unwrap
(ByteBuffer[] srcs, ByteBuffer[] dsts) final SSLEngineResult
unwrap
(ByteBuffer src, ByteBuffer dst) final SSLEngineResult
unwrap
(ByteBuffer src, ByteBuffer[] dsts) final SSLEngineResult
unwrap
(ByteBuffer src, ByteBuffer[] dsts, int offset, int length) final SSLEngineResult
wrap
(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst) final SSLEngineResult
wrap
(ByteBuffer src, ByteBuffer dst) private ByteBuf
writeEncryptedData
(ByteBuffer src, int len) Write encrypted data to the OpenSSL network BIO.private int
writePlaintextData
(ByteBuffer src, int len) Write plaintext data to the OpenSSL internal BIO Calling this function with src.remaining == 0 is undefined.Methods inherited from class javax.net.ssl.SSLEngine
getHandshakeApplicationProtocolSelector, getPeerHost, getPeerPort, setHandshakeApplicationProtocolSelector, wrap
-
Field Details
-
logger
-
leakDetector
-
OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV2- See Also:
-
OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_SSLV3- See Also:
-
OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1- See Also:
-
OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_1- See Also:
-
OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_2
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_2- See Also:
-
OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_3
private static final int OPENSSL_OP_NO_PROTOCOL_INDEX_TLSv1_3- See Also:
-
OPENSSL_OP_NO_PROTOCOLS
private static final int[] OPENSSL_OP_NO_PROTOCOLS -
MAX_PLAINTEXT_LENGTH
static final int MAX_PLAINTEXT_LENGTHDepends upon tcnative ... only use if tcnative is available! -
MAX_RECORD_SIZE
static final int MAX_RECORD_SIZEDepends upon tcnative ... only use if tcnative is available! -
NEED_UNWRAP_OK
-
NEED_UNWRAP_CLOSED
-
NEED_WRAP_OK
-
NEED_WRAP_CLOSED
-
CLOSED_NOT_HANDSHAKING
-
ssl
private long ssl -
networkBIO
private long networkBIO -
handshakeState
-
receivedShutdown
private boolean receivedShutdown -
destroyed
private volatile boolean destroyed -
applicationProtocol
-
needTask
private volatile boolean needTask -
hasTLSv13Cipher
private boolean hasTLSv13Cipher -
sessionSet
private boolean sessionSet -
leak
-
refCnt
-
enabledProtocols
-
clientAuth
-
endpointIdentificationAlgorithm
-
algorithmConstraints
-
sniHostNames
-
matchers
-
isInboundDone
private boolean isInboundDone -
outboundClosed
private boolean outboundClosed -
jdkCompatibilityMode
final boolean jdkCompatibilityMode -
clientMode
private final boolean clientMode -
alloc
-
engineMap
-
apn
-
parentContext
-
session
-
singleSrcBuffer
-
singleDstBuffer
-
enableOcsp
private final boolean enableOcsp -
maxWrapOverhead
private int maxWrapOverhead -
maxWrapBufferSize
private int maxWrapBufferSize -
pendingException
-
JAVAX_CERTS_NOT_SUPPORTED
-
-
Constructor Details
-
ReferenceCountedOpenSslEngine
ReferenceCountedOpenSslEngine(ReferenceCountedOpenSslContext context, ByteBufAllocator alloc, String peerHost, int peerPort, boolean jdkCompatibilityMode, boolean leakDetection, String endpointIdentificationAlgorithm) Create a new instance.- Parameters:
context
- Reference count release responsibility is not transferred! The callee still owns this object.alloc
- The allocator to use.peerHost
- The peer host name.peerPort
- The peer port.jdkCompatibilityMode
-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.leakDetection
-true
to enable leak detection of this object.
-
-
Method Details
-
authMethods
-
setKeyMaterial
- Throws:
Exception
-
masterKey
-
isSessionReused
boolean isSessionReused() -
setOcspResponse
Sets the OCSP response. -
getOcspResponse
Returns the OCSP response ornull
if the server didn't provide a stapled OCSP response. -
refCnt
public final int refCnt()Description copied from interface:ReferenceCounted
Returns the reference count of this object. If0
, it means this object has been deallocated.- Specified by:
refCnt
in interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCounted
Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
. This method is a shortcut totouch(null)
.- Specified by:
touch
in interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
.- Specified by:
touch
in interfaceReferenceCounted
-
release
public final boolean release()Description copied from interface:ReferenceCounted
Decreases the reference count by1
and deallocates this object if the reference count reaches at0
.- Specified by:
release
in interfaceReferenceCounted
- Returns:
true
if and only if the reference count became0
and this object has been deallocated
-
release
public final boolean release(int decrement) Description copied from interface:ReferenceCounted
Decreases the reference count by the specifieddecrement
and deallocates this object if the reference count reaches at0
.- Specified by:
release
in interfaceReferenceCounted
- Returns:
true
if and only if the reference count became0
and this object has been deallocated
-
getApplicationProtocol
- Overrides:
getApplicationProtocol
in classSSLEngine
-
getHandshakeApplicationProtocol
- Overrides:
getHandshakeApplicationProtocol
in classSSLEngine
-
getHandshakeSession
- Overrides:
getHandshakeSession
in classSSLEngine
-
sslPointer
public final long sslPointer()Returns the pointer to theSSL
object for thisReferenceCountedOpenSslEngine
. Be aware that it is freed as soon as therelease()
orshutdown()
methods are called. At this point0
will be returned. -
shutdown
public final void shutdown()Destroys this engine. -
writePlaintextData
Write plaintext data to the OpenSSL internal BIO Calling this function with src.remaining == 0 is undefined. -
bioSetFd
void bioSetFd(int fd) -
writeEncryptedData
Write encrypted data to the OpenSSL network BIO.- Throws:
SSLException
-
readPlaintextData
Read plaintext data from the OpenSSL internal BIO- Throws:
SSLException
-
maxWrapOverhead
final int maxWrapOverhead()Visible only for testing! -
maxEncryptedPacketLength
final int maxEncryptedPacketLength()Visible only for testing! -
maxEncryptedPacketLength0
final int maxEncryptedPacketLength0()This method is intentionally not synchronized, only use if you know you are in the EventLoop thread and visibility onmaxWrapOverhead
is achieved via other synchronized blocks. -
calculateMaxLengthForWrap
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 onmaxWrapBufferSize
andmaxWrapOverhead
is achieved via other synchronized blocks.
Calculates the max size of a single wrap operation for the given plaintextLength and numComponents. -
calculateOutNetBufSize
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 onmaxWrapOverhead
is achieved via other synchronized blocks.
Calculates the size of the out net buf to create for the given plaintextLength and numComponents. This is not related to the max size per wrap, as we can wrap chunks at a time into one out net buf. -
sslPending
final int sslPending() -
calculateMaxWrapOverhead
private void calculateMaxWrapOverhead()It is assumed this method is called in a synchronized block (or the constructor)! -
sslPending0
private int sslPending0() -
isBytesAvailableEnoughForWrap
private boolean isBytesAvailableEnoughForWrap(int bytesAvailable, int plaintextLength, int numComponents) -
wrap
public final SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst) throws SSLException - Specified by:
wrap
in classSSLEngine
- Throws:
SSLException
-
newResult
private SSLEngineResult newResult(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) -
newResult
private SSLEngineResult newResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) -
newResultMayFinishHandshake
private SSLEngineResult newResultMayFinishHandshake(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) throws SSLException - Throws:
SSLException
-
newResultMayFinishHandshake
private SSLEngineResult newResultMayFinishHandshake(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) throws SSLException - Throws:
SSLException
-
shutdownWithError
Log the error, shutdown the engine and throw an exception. -
handleUnwrapException
private SSLEngineResult handleUnwrapException(int bytesConsumed, int bytesProduced, SSLException e) throws SSLException - Throws:
SSLException
-
unwrap
public final SSLEngineResult unwrap(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws SSLException - Throws:
SSLException
-
needWrapAgain
private boolean needWrapAgain(int stackError) -
newSSLExceptionForError
-
shouldAddSuppressed
-
sslReadErrorResult
private SSLEngineResult sslReadErrorResult(int error, int stackError, int bytesConsumed, int bytesProduced) throws SSLException - Throws:
SSLException
-
closeAll
- Throws:
SSLException
-
rejectRemoteInitiatedRenegotiation
- Throws:
SSLHandshakeException
-
unwrap
- Throws:
SSLException
-
singleSrcBuffer
-
resetSingleSrcBuffer
private void resetSingleSrcBuffer() -
singleDstBuffer
-
resetSingleDstBuffer
private void resetSingleDstBuffer() -
unwrap
public final SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts, int offset, int length) throws SSLException - Specified by:
unwrap
in classSSLEngine
- Throws:
SSLException
-
wrap
- Overrides:
wrap
in classSSLEngine
- Throws:
SSLException
-
unwrap
- Overrides:
unwrap
in classSSLEngine
- Throws:
SSLException
-
unwrap
- Overrides:
unwrap
in classSSLEngine
- Throws:
SSLException
-
runAndResetNeedTask
-
getDelegatedTask
- Specified by:
getDelegatedTask
in classSSLEngine
-
closeInbound
- Specified by:
closeInbound
in classSSLEngine
- Throws:
SSLException
-
isInboundDone
public final boolean isInboundDone()- Specified by:
isInboundDone
in classSSLEngine
-
closeOutbound
public final void closeOutbound()- Specified by:
closeOutbound
in classSSLEngine
-
doSSLShutdown
private boolean doSSLShutdown()Attempt to callSSL.shutdownSSL(long)
.- Returns:
false
if the call toSSL.shutdownSSL(long)
was not attempted or returned an error.
-
isOutboundDone
public final boolean isOutboundDone()- Specified by:
isOutboundDone
in classSSLEngine
-
getSupportedCipherSuites
- Specified by:
getSupportedCipherSuites
in classSSLEngine
-
getEnabledCipherSuites
- Specified by:
getEnabledCipherSuites
in classSSLEngine
-
setEnabledCipherSuites
- Specified by:
setEnabledCipherSuites
in classSSLEngine
-
getSupportedProtocols
- Specified by:
getSupportedProtocols
in classSSLEngine
-
getEnabledProtocols
- Specified by:
getEnabledProtocols
in classSSLEngine
-
isProtocolEnabled
-
setEnabledProtocols
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. The TLS protocol also doesn't support all different combinations of discrete protocols, and instead assumes contiguous ranges. OpenSSL has some unexpected behavior (e.g. handshake failures) if non-contiguous protocols are used even where there is a compatible set of protocols and ciphers. For these reasons this method will determine the minimum protocol and the maximum protocol and enabled a contiguous range from [min protocol, max protocol] in OpenSSL.- Specified by:
setEnabledProtocols
in classSSLEngine
-
setEnabledProtocols0
-
getSession
- Specified by:
getSession
in classSSLEngine
-
beginHandshake
- Specified by:
beginHandshake
in classSSLEngine
- Throws:
SSLException
-
checkEngineClosed
- Throws:
SSLException
-
pendingStatus
-
isEmpty
-
isEmpty
private static boolean isEmpty(byte[] cert) -
handshakeException
- Throws:
SSLException
-
initHandshakeException
Should be called if the handshake will be failed due a callback that throws an exception. This cause will then be used to give more details as part of theSSLHandshakeException
. -
handshake
- Throws:
SSLException
-
mayFinishHandshake
private SSLEngineResult.HandshakeStatus mayFinishHandshake(SSLEngineResult.HandshakeStatus hs, int bytesConsumed, int bytesProduced) throws SSLException - Throws:
SSLException
-
mayFinishHandshake
private SSLEngineResult.HandshakeStatus mayFinishHandshake(SSLEngineResult.HandshakeStatus status) throws SSLException - Throws:
SSLException
-
getHandshakeStatus
- Specified by:
getHandshakeStatus
in classSSLEngine
-
getHandshakeStatus
-
needPendingStatus
private boolean needPendingStatus() -
toJavaCipherSuite
Converts the specified OpenSSL cipher suite to the Java cipher suite. -
toJavaCipherSuitePrefix
Converts the protocol version string returned bySSL.getVersion(long)
to protocol family string. -
setUseClientMode
public final void setUseClientMode(boolean clientMode) - Specified by:
setUseClientMode
in classSSLEngine
-
getUseClientMode
public final boolean getUseClientMode()- Specified by:
getUseClientMode
in classSSLEngine
-
setNeedClientAuth
public final void setNeedClientAuth(boolean b) - Specified by:
setNeedClientAuth
in classSSLEngine
-
getNeedClientAuth
public final boolean getNeedClientAuth()- Specified by:
getNeedClientAuth
in classSSLEngine
-
setWantClientAuth
public final void setWantClientAuth(boolean b) - Specified by:
setWantClientAuth
in classSSLEngine
-
getWantClientAuth
public final boolean getWantClientAuth()- Specified by:
getWantClientAuth
in classSSLEngine
-
setVerify
See SSL_set_verify andSSL.setVerify(long, int, int)
. -
setClientAuth
-
setEnableSessionCreation
public final void setEnableSessionCreation(boolean b) - Specified by:
setEnableSessionCreation
in classSSLEngine
-
getEnableSessionCreation
public final boolean getEnableSessionCreation()- Specified by:
getEnableSessionCreation
in classSSLEngine
-
getSSLParameters
- Overrides:
getSSLParameters
in classSSLEngine
-
setSSLParameters
- Overrides:
setSSLParameters
in classSSLEngine
-
configureEndpointVerification
-
isEndPointVerificationEnabled
-
isDestroyed
private boolean isDestroyed() -
checkSniHostnameMatch
final boolean checkSniHostnameMatch(byte[] hostname) -
getNegotiatedApplicationProtocol
Description copied from interface:ApplicationProtocolAccessor
Returns the name of the negotiated application-level protocol.- Specified by:
getNegotiatedApplicationProtocol
in interfaceApplicationProtocolAccessor
- Returns:
- the application-level protocol name or
null
if the negotiation failed or the client does not have ALPN/NPN extension
-
bufferAddress
-
selectApplicationProtocol
Select the application protocol used.- Throws:
SSLException
-
selectApplicationProtocol
private String selectApplicationProtocol(List<String> protocols, ApplicationProtocolConfig.SelectedListenerFailureBehavior behavior, String applicationProtocol) throws SSLException - Throws:
SSLException
-