Package org.conscrypt
Class ApplicationProtocolSelector
- java.lang.Object
-
- org.conscrypt.ApplicationProtocolSelector
-
public abstract class ApplicationProtocolSelector extends java.lang.Object
Server-side selector for the ALPN protocol. This is a backward-compatibility shim for Java 9's newsetHandshakeApplicationProtocolSelector
API, which takes aBiFunction
(available in Java 8+). This interface is provided to support protocol selection in Java < 8.
-
-
Constructor Summary
Constructors Constructor Description ApplicationProtocolSelector()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.String
selectApplicationProtocol(javax.net.ssl.SSLEngine engine, java.util.List<java.lang.String> protocols)
Selects the appropriate ALPN protocol.abstract java.lang.String
selectApplicationProtocol(javax.net.ssl.SSLSocket socket, java.util.List<java.lang.String> protocols)
Selects the appropriate ALPN protocol.
-
-
-
Method Detail
-
selectApplicationProtocol
public abstract java.lang.String selectApplicationProtocol(javax.net.ssl.SSLEngine engine, java.util.List<java.lang.String> protocols)
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
public abstract java.lang.String selectApplicationProtocol(javax.net.ssl.SSLSocket socket, java.util.List<java.lang.String> protocols)
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.
-
-