Class H2ClientTlsStrategy

  • All Implemented Interfaces:
    TlsStrategy

    public class H2ClientTlsStrategy
    extends java.lang.Object
    implements TlsStrategy
    Default client-side implementation of TlsStrategy that upgrades outbound connections with TLS security. This strategy will try to negotiate an application protocol using TLS ALPN extension based on HttpVersionPolicy passed to the strategy as an attachment. The strategy will also enforce restrictions on TLS parameters required by the HTTP/2 specification.
    Since:
    5.0
    • Constructor Detail

      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext,
                                   SSLSessionVerifier verifier)
      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext)
      • H2ClientTlsStrategy

        public H2ClientTlsStrategy()
    • Method Detail

      • upgrade

        public void upgrade​(TransportSecurityLayer tlsSession,
                            NamedEndpoint endpoint,
                            java.lang.Object attachment,
                            Timeout handshakeTimeout,
                            FutureCallback<TransportSecurityLayer> callback)
        Description copied from interface: TlsStrategy
        Secures current session layer with TLS.
        Specified by:
        upgrade in interface TlsStrategy
        Parameters:
        tlsSession - the session layer
        endpoint - the name of the opposite endpoint when applicable or null otherwise.
        attachment - arbitrary object passes to the TLS session initialization code.
        handshakeTimeout - the timeout to use while performing the TLS handshake; may be null.
        callback - Operation result callback.
      • upgrade

        @Deprecated
        public boolean upgrade​(TransportSecurityLayer tlsSession,
                               HttpHost host,
                               java.net.SocketAddress localAddress,
                               java.net.SocketAddress remoteAddress,
                               java.lang.Object attachment,
                               Timeout handshakeTimeout)
        Description copied from interface: TlsStrategy
        Secures current session layer with TLS.
        Specified by:
        upgrade in interface TlsStrategy
        Parameters:
        tlsSession - the session layer
        host - the name of the opposite endpoint when given or null otherwise.
        localAddress - the address of the local endpoint.
        remoteAddress - the address of the remote endpoint.
        attachment - arbitrary object passes to the TLS session initialization code.
        handshakeTimeout - the timeout to use while performing the TLS handshake; may be null.
        Returns:
        true if the session has been upgraded, false otherwise.