Package: org.conscrypt
ApplicationProtocolSelector
public abstract class 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
<
8.
Constructors
public ApplicationProtocolSelector()
Public Methods
selectApplicationProtocol
public abstract String selectApplicationProtocol(SSLEngine engine, String> protocols)
Selects the appropriate ALPN protocol.
| Parameters |
| engine |
the server-side engine |
| protocols |
The list of client-supplied protocols |
| Returns |
| java.lang.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, a
"no_application_protocol" alert will be sent to the peer and the connection will be
terminated. |
selectApplicationProtocol
public abstract String selectApplicationProtocol(SSLSocket socket, String> protocols)
Selects the appropriate ALPN protocol.
| Parameters |
| socket |
the server-side socket |
| protocols |
The list of client-supplied protocols |
| Returns |
| java.lang.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, a
"no_application_protocol" alert will be sent to the peer and the connection will be
terminated. |