Class H2ClientTlsStrategy

  • All Implemented Interfaces:
    org.apache.hc.core5.http.nio.ssl.TlsStrategy

    public class H2ClientTlsStrategy
    extends java.lang.Object
    implements org.apache.hc.core5.http.nio.ssl.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 Summary

      Constructors 
      Constructor Description
      H2ClientTlsStrategy()  
      H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext)  
      H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)  
      H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext, org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)  
      H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext, org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)  
      H2ClientTlsStrategy​(org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)
      Constructor with the default SSL context based on system properties and custom SSLSessionVerifier.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean upgrade​(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.http.HttpHost host, java.net.SocketAddress localAddress, java.net.SocketAddress remoteAddress, java.lang.Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout)
      void upgrade​(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.net.NamedEndpoint endpoint, java.lang.Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback)  
      • Methods inherited from class java.lang.Object

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

      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext,
                                   org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode,
                                   org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer,
                                   org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)
      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext,
                                   org.apache.hc.core5.reactor.ssl.SSLSessionInitializer initializer,
                                   org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)
      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(javax.net.ssl.SSLContext sslContext,
                                   org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)
      • H2ClientTlsStrategy

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

        public H2ClientTlsStrategy()
      • H2ClientTlsStrategy

        public H2ClientTlsStrategy​(org.apache.hc.core5.reactor.ssl.SSLSessionVerifier verifier)
        Constructor with the default SSL context based on system properties and custom SSLSessionVerifier.
        Parameters:
        verifier - the custom SSLSessionVerifier.
        Since:
        5.2
        See Also:
        SSLContext
    • Method Detail

      • upgrade

        public void upgrade​(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession,
                            org.apache.hc.core5.net.NamedEndpoint endpoint,
                            java.lang.Object attachment,
                            org.apache.hc.core5.util.Timeout handshakeTimeout,
                            org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback)
        Specified by:
        upgrade in interface org.apache.hc.core5.http.nio.ssl.TlsStrategy
      • upgrade

        @Deprecated
        public boolean upgrade​(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession,
                               org.apache.hc.core5.http.HttpHost host,
                               java.net.SocketAddress localAddress,
                               java.net.SocketAddress remoteAddress,
                               java.lang.Object attachment,
                               org.apache.hc.core5.util.Timeout handshakeTimeout)
        Specified by:
        upgrade in interface org.apache.hc.core5.http.nio.ssl.TlsStrategy