Package org.conscrypt
Class ApplicationProtocolSelector
java.lang.Object
org.conscrypt.ApplicationProtocolSelector
Server-side selector for the ALPN protocol. This is a backward-compatibility shim for Java 9's
new
setHandshakeApplicationProtocolSelector
API, which takes a BiFunction
(available in Java 8+). This interface is provided to support protocol selection in Java invalid input: '<' 8.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
selectApplicationProtocol
(SSLEngine engine, List<String> protocols) Selects the appropriate ALPN protocol.abstract String
selectApplicationProtocol
(SSLSocket socket, List<String> protocols) Selects the appropriate ALPN protocol.
-
Constructor Details
-
ApplicationProtocolSelector
public ApplicationProtocolSelector()
-
-
Method Details
-
selectApplicationProtocol
Selects the appropriate ALPN protocol.- Parameters:
engine
- the server-side engineprotocols
- The list of client-supplied protocols- Returns:
- 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 emptyString
then application protocol indications will not be used. If the return value isnull
(no value chosen) or is a value that was not advertised by the peer, a "no_application_protocol" alert will be sent to the peer and the connection will be terminated.
-
selectApplicationProtocol
Selects the appropriate ALPN protocol.- Parameters:
socket
- the server-side socketprotocols
- The list of client-supplied protocols- Returns:
- 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 emptyString
then application protocol indications will not be used. If the return value isnull
(no value chosen) or is a value that was not advertised by the peer, a "no_application_protocol" alert will be sent to the peer and the connection will be terminated.
-