org.apache.hc.client5.http.ssl

## Class ConscryptClientTlsStrategy

- java.lang.Object
- - org.apache.hc.client5.http.ssl.ConscryptClientTlsStrategy

- All Implemented Interfaces:
    TlsSocketStrategy, org.apache.hc.core5.http.nio.ssl.TlsStrategy

      @Contract(threading=STATELESS)
      public class ConscryptClientTlsStrategy
      extends Object

  TLS upgrade strategy for non-blocking client connections using Conscrypt TLS library.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConscryptClientTlsStrategy(SSLContext sslContext)`
    `ConscryptClientTlsStrategy(SSLContext sslContext, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier)`
    `ConscryptClientTlsStrategy(SSLContext sslContext, HostnameVerifier hostnameVerifier)`
    `ConscryptClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier)`
    `ConscryptClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerifier hostnameVerifier)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.apache.hc.core5.http.nio.ssl.TlsStrategy` | `getDefault()`
    `static org.apache.hc.core5.http.nio.ssl.TlsStrategy` | `getSystemDefault()`
    `protected void` | `initializeEngine(SSLEngine sslEngine)`
    `protected void` | `initializeSocket(SSLSocket socket)`
    `static boolean` | `isSupported()`
    `SSLSocket` | `upgrade(Socket socket, String target, int port, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context)` Upgrades the given plain socket and executes the TLS handshake over it.
    `boolean` | `upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.http.HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout)` Deprecated. use `upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)`
    `void` | `upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.net.NamedEndpoint endpoint, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback)`
    `protected void` | `verifySession(String hostname, SSLSession sslsession)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConscryptClientTlsStrategy

          public ConscryptClientTlsStrategy(SSLContext sslContext,
                                            String[] supportedProtocols,
                                            String[] supportedCipherSuites,
                                            org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement,
                                            HostnameVerifier hostnameVerifier)

    - #### ConscryptClientTlsStrategy

          public ConscryptClientTlsStrategy(SSLContext sslContext,
                                            String[] supportedProtocols,
                                            String[] supportedCipherSuites,
                                            org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement,
                                            HostnameVerificationPolicy hostnameVerificationPolicy,
                                            HostnameVerifier hostnameVerifier)

      Since:
        5.4

    - #### ConscryptClientTlsStrategy

          public ConscryptClientTlsStrategy(SSLContext sslContext,
                                            HostnameVerifier hostnameVerifier)

    - #### ConscryptClientTlsStrategy

          public ConscryptClientTlsStrategy(SSLContext sslContext,
                                            HostnameVerificationPolicy hostnameVerificationPolicy,
                                            HostnameVerifier hostnameVerifier)

      Since:
        5.4

    - #### ConscryptClientTlsStrategy

          public ConscryptClientTlsStrategy(SSLContext sslContext)

  - ### Method Detail

    - #### getDefault

          public static org.apache.hc.core5.http.nio.ssl.TlsStrategy getDefault()

    - #### getSystemDefault

          public static org.apache.hc.core5.http.nio.ssl.TlsStrategy getSystemDefault()

    - #### isSupported

          public static boolean isSupported()

    - #### upgrade

          @Deprecated
          public boolean upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession,
                                             org.apache.hc.core5.http.HttpHost host,
                                             SocketAddress localAddress,
                                             SocketAddress remoteAddress,
                                             Object attachment,
                                             org.apache.hc.core5.util.Timeout handshakeTimeout)

      Deprecated. use `upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)`
      Specified by:
        `upgrade` in interface `org.apache.hc.core5.http.nio.ssl.TlsStrategy`

    - #### upgrade

          public void upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession,
                              org.apache.hc.core5.net.NamedEndpoint endpoint,
                              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`

    - #### initializeEngine

          protected void initializeEngine(SSLEngine sslEngine)

    - #### initializeSocket

          protected void initializeSocket(SSLSocket socket)

    - #### verifySession

          protected void verifySession(String hostname,
                                       SSLSession sslsession)
                                throws SSLException

      Throws:
        `SSLException`

    - #### upgrade

          public SSLSocket upgrade(Socket socket,
                                   String target,
                                   int port,
                                   Object attachment,
                                   org.apache.hc.core5.http.protocol.HttpContext context)
                            throws IOException

      Description copied from interface: `TlsSocketStrategy`
      Upgrades the given plain socket and executes the TLS handshake over it.
      Specified by:
        `upgrade` in interface `TlsSocketStrategy`
      Parameters:
        `socket` - the existing plain socket
        `target` - the name of the target host.
        `port` - the port to connect to on the target host.
        `attachment` - connect request attachment.
        `context` - the actual HTTP context.
      Returns:
        socket upgraded to TLS.
      Throws:
        `IOException`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.