Top Description Constructors Methods
org.conscrypt

public abstract Class ApplicationProtocolSelector

extends Object
Class Inheritance
Imports
java.util.List, javax.net.ssl.SSLEngine, .SSLSocket

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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract String

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 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
(SSLEngine
the server-side engine
engine
,
List<String>
The list of client-supplied protocols
protocols
)

Selects the appropriate ALPN protocol.

public abstract String

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 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
(SSLSocket
the server-side socket
socket
,
List<String>
The list of client-supplied protocols
protocols
)

Selects the appropriate ALPN protocol.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ApplicationProtocolSelectorback to summary
public ApplicationProtocolSelector()

Method Detail

selectApplicationProtocolback to summary
public abstract String selectApplicationProtocol(SSLEngine engine, List<String> protocols)

Selects the appropriate ALPN protocol.

Parameters
engine:SSLEngine

the server-side engine

protocols:List<String>

The list of client-supplied protocols

Returns: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.

selectApplicationProtocolback to summary
public abstract String selectApplicationProtocol(SSLSocket socket, List<String> protocols)

Selects the appropriate ALPN protocol.

Parameters
socket:SSLSocket

the server-side socket

protocols:List<String>

The list of client-supplied protocols

Returns: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.