Package org.conscrypt

Class 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 new setHandshakeApplicationProtocolSelector API, which takes a BiFunction (available in Java 8+). This interface is provided to support protocol selection in Java < 8.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ApplicationProtocolSelector

        public ApplicationProtocolSelector()
    • 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 engine
        protocols - 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 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 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 socket
        protocols - 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 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.