Package io.netty.handler.ssl
Class JdkAlpnSslEngine
java.lang.Object
javax.net.ssl.SSLEngine
io.netty.handler.ssl.JdkSslEngine
io.netty.handler.ssl.JdkAlpnSslEngine
- All Implemented Interfaces:
ApplicationProtocolAccessor
- Direct Known Subclasses:
BouncyCastleAlpnSslEngine
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJdkAlpnSslEngine
(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer) JdkAlpnSslEngine
(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer, BiConsumer<SSLEngine, JdkAlpnSslEngine.AlpnSelector> setHandshakeApplicationProtocolSelector, BiConsumer<SSLEngine, List<String>> setApplicationProtocols) -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the negotiated application-level protocol.void
(package private) void
setNegotiatedApplicationProtocol
(String applicationProtocol) unwrap
(ByteBuffer src, ByteBuffer dst) unwrap
(ByteBuffer src, ByteBuffer[] dsts) unwrap
(ByteBuffer src, ByteBuffer[] dst, int offset, int len) private SSLEngineResult
wrap
(ByteBuffer[] srcs, int offset, int len, ByteBuffer dst) wrap
(ByteBuffer[] srcs, ByteBuffer dst) wrap
(ByteBuffer src, ByteBuffer dst) Methods inherited from class io.netty.handler.ssl.JdkSslEngine
beginHandshake, closeInbound, closeOutbound, getDelegatedTask, getEnabledCipherSuites, getEnabledProtocols, getEnableSessionCreation, getHandshakeSession, getHandshakeStatus, getNeedClientAuth, getPeerHost, getPeerPort, getSession, getSSLParameters, getSupportedCipherSuites, getSupportedProtocols, getUseClientMode, getWantClientAuth, getWrappedEngine, isInboundDone, isOutboundDone, setEnabledCipherSuites, setEnabledProtocols, setEnableSessionCreation, setNeedClientAuth, setSSLParameters, setUseClientMode, setWantClientAuth
-
Field Details
-
selectionListener
-
alpnSelector
-
-
Constructor Details
-
JdkAlpnSslEngine
JdkAlpnSslEngine(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer, BiConsumer<SSLEngine, JdkAlpnSslEngine.AlpnSelector> setHandshakeApplicationProtocolSelector, BiConsumer<SSLEngine, List<String>> setApplicationProtocols) -
JdkAlpnSslEngine
JdkAlpnSslEngine(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer)
-
-
Method Details
-
verifyProtocolSelection
- Throws:
SSLException
-
wrap
- Overrides:
wrap
in classJdkSslEngine
- Throws:
SSLException
-
wrap
- Overrides:
wrap
in classJdkSslEngine
- Throws:
SSLException
-
wrap
public SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int len, ByteBuffer dst) throws SSLException - Overrides:
wrap
in classJdkSslEngine
- Throws:
SSLException
-
unwrap
- Overrides:
unwrap
in classJdkSslEngine
- Throws:
SSLException
-
unwrap
- Overrides:
unwrap
in classJdkSslEngine
- Throws:
SSLException
-
unwrap
public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dst, int offset, int len) throws SSLException - Overrides:
unwrap
in classJdkSslEngine
- Throws:
SSLException
-
setNegotiatedApplicationProtocol
- Overrides:
setNegotiatedApplicationProtocol
in classJdkSslEngine
-
getNegotiatedApplicationProtocol
Description copied from interface:ApplicationProtocolAccessor
Returns the name of the negotiated application-level protocol.- Specified by:
getNegotiatedApplicationProtocol
in interfaceApplicationProtocolAccessor
- Overrides:
getNegotiatedApplicationProtocol
in classJdkSslEngine
- Returns:
- the application-level protocol name or
null
if the negotiation failed or the client does not have ALPN/NPN extension
-
getApplicationProtocol
- Overrides:
getApplicationProtocol
in classSSLEngine
-
getHandshakeApplicationProtocol
- Overrides:
getHandshakeApplicationProtocol
in classSSLEngine
-
setHandshakeApplicationProtocolSelector
public void setHandshakeApplicationProtocolSelector(BiFunction<SSLEngine, List<String>, String> selector) - Overrides:
setHandshakeApplicationProtocolSelector
in classSSLEngine
-
getHandshakeApplicationProtocolSelector
- Overrides:
getHandshakeApplicationProtocolSelector
in classSSLEngine
-