Top Constructors Methods
io.netty5.handler.ssl

pack-priv final Class BouncyCastleAlpnSslEngine

extends JdkAlpnSslEngine
Class Inheritance
Imports
javax.net.ssl.SSLEngine, java.util.List, java.util.function.BiFunction

Constructor Summary

AccessConstructor and Description
pack-priv
BouncyCastleAlpnSslEngine(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer)

Deprecated as a consequence of JdkApplicationProtocolNegotiator being deprecated.

Method Summary

Modifier and TypeMethod and Description
public String
getApplicationProtocol()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getApplicationProtocol.

Returns the most recent application protocol value negotiated for this connection.
public String
getHandshakeApplicationProtocol()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getHandshakeApplicationProtocol.

Returns the application protocol value negotiated on a SSL/TLS handshake currently in progress.
public BiFunction<SSLEngine, List<String>, String>
getHandshakeApplicationProtocolSelector()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getHandshakeApplicationProtocolSelector.

Retrieves the callback function that selects an application protocol value during a SSL/TLS/DTLS handshake.
public void
setHandshakeApplicationProtocolSelector(BiFunction<SSLEngine, List<String>, String>
the callback function, or null to disable the callback functionality.
selector
)

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.setHandshakeApplicationProtocolSelector.

Registers a callback function that selects an application protocol value for a SSL/TLS/DTLS handshake.
Inherited from io.netty5.handler.ssl.JdkAlpnSslEngine:
getNegotiatedApplicationProtocolsetNegotiatedApplicationProtocolunwrapunwrapunwrapwrapwrapwrap

Constructor Detail

BouncyCastleAlpnSslEngineback to summary
pack-priv BouncyCastleAlpnSslEngine(SSLEngine engine, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer)

Deprecated

as a consequence of JdkApplicationProtocolNegotiator being deprecated. See corresponding docs for further information.

Method Detail

getApplicationProtocolback to summary
public String getApplicationProtocol()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getApplicationProtocol.

Doc from javax.net.ssl.SSLEngine.getApplicationProtocol.

Returns the most recent application protocol value negotiated for this connection.

If supported by the underlying SSL/TLS/DTLS implementation, application name negotiation mechanisms such as RFC 7301 , the Application-Layer Protocol Negotiation (ALPN), can negotiate application-level values between peers.

Returns:String

null if it has not yet been determined if application protocols might be used for this connection, an empty String if application protocols values will not be used, or a non-empty application protocol String if a value was successfully negotiated.

Annotations
@Override
getHandshakeApplicationProtocolback to summary
public String getHandshakeApplicationProtocol()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getHandshakeApplicationProtocol.

Doc from javax.net.ssl.SSLEngine.getHandshakeApplicationProtocol.

Returns the application protocol value negotiated on a SSL/TLS handshake currently in progress.

Like getHandshakeSession(), a connection may be in the middle of a handshake. The application protocol may or may not yet be available.

Returns:String

null if it has not yet been determined if application protocols might be used for this handshake, an empty String if application protocols values will not be used, or a non-empty application protocol String if a value was successfully negotiated.

Annotations
@Override
getHandshakeApplicationProtocolSelectorback to summary
public BiFunction<SSLEngine, List<String>, String> getHandshakeApplicationProtocolSelector()

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.getHandshakeApplicationProtocolSelector.

Doc from javax.net.ssl.SSLEngine.getHandshakeApplicationProtocolSelector.

Retrieves the callback function that selects an application protocol value during a SSL/TLS/DTLS handshake. See setHandshakeApplicationProtocolSelector for the function's type parameters.

Returns:BiFunction<SSLEngine, List<String>, String>

the callback function, or null if none has been set.

Annotations
@Override
setHandshakeApplicationProtocolSelectorback to summary
public void setHandshakeApplicationProtocolSelector(BiFunction<SSLEngine, List<String>, String> selector)

Overrides io.netty5.handler.ssl.JdkAlpnSslEngine.setHandshakeApplicationProtocolSelector.

Doc from javax.net.ssl.SSLEngine.setHandshakeApplicationProtocolSelector.

Registers a callback function that selects an application protocol value for a SSL/TLS/DTLS handshake. The function overrides any values supplied using SSLParameters.setApplicationProtocols and it supports the following type parameters:

SSLEngine
The function's first argument allows the current SSLEngine to be inspected, including the handshake session and configuration settings.
List<String>
The function's second argument lists the application protocol names advertised by the TLS peer.
String
The function's result is an application protocol name, or null to indicate that none of the advertised names are acceptable. If the return value is an empty String then application protocol indications will not be used. If the return value is null (no value chosen) or is a value that was not advertised by the peer, the underlying protocol will determine what action to take. (For example, ALPN will send a "no_application_protocol" alert and terminate the connection.)
For example, the following call registers a callback function that examines the TLS handshake parameters and selects an application protocol name:
serverEngine.setHandshakeApplicationProtocolSelector(
        (serverEngine, clientProtocols) -> {
            SSLSession session = serverEngine.getHandshakeSession();
            return chooseApplicationProtocol(
                serverEngine,
                clientProtocols,
                session.getProtocol(),
                session.getCipherSuite());
        });
Parameters
selector:BiFunction<SSLEngine, List<String>, String>

the callback function, or null to disable the callback functionality.

Annotations
@Override