Interface AlpnClientNegotiator


public interface AlpnClientNegotiator

Called during the SSL handshake when the current SSLEngine's getUseClientMode has returned true. Implementations must be thread safe.

  • Method Details

    • getProtocols

      String[] getProtocols(SSLEngine sslEngine)

      Return the supported protocols. For HTTP/2 this should be the two literal strings "h2" and "http/1.1", without the quotes. This method is called by the underlying SSL framework.

      Parameters:
      sslEngine - the SSLEngine for this connection.
      Returns:
      A newly allocated String array of protocols supported.
    • protocolSelected

      void protocolSelected(SSLEngine sslEngine, String selectedProtocol)

      Inform the implementor which of the protocols returned from getProtocols(javax.net.ssl.SSLEngine) was actually selected.

      For HTTP/2, if the argument is "h2", proceed to use the HTTP/2 protocol for the remainder of this connection. Otherwise, take the necessary action to use HTTP/1.1.

      Parameters:
      sslEngine - the SSLEngine for this connection.
      selectedProtocol - The selected protocol.