Class BasicClientTlsStrategy

  • All Implemented Interfaces:
    TlsStrategy

    public class BasicClientTlsStrategy
    extends java.lang.Object
    implements TlsStrategy
    Basic client-side implementation of TlsStrategy that upgrades outbound connections with TLS security but does not make use of TLS ALPN extension to negotiate an application protocol. This strategy will also automatically enforce restrictions on TLS parameters by excluding TLS versions and ciphers considered weak.

    This strategy should not be used unless no TLS ALPN support is actually desired. One is advised to use a custom TlsStrategy implementation or an implementation provided by the HTTP/2 module.

    Since:
    5.0
    • Constructor Detail

      • BasicClientTlsStrategy

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

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

        public BasicClientTlsStrategy()
      • BasicClientTlsStrategy

        public BasicClientTlsStrategy​(SSLSessionVerifier verifier)
        Constructor with the default SSL context based on system properties and custom SSLSessionVerifier verifier.
        Parameters:
        verifier - the custom SSLSessionVerifier.
        Since:
        5.2
        See Also:
        SSLContext
    • 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.