org.apache.hc.core5.http2.ssl

## Class ConscryptServerTlsStrategy

- java.lang.Object
- - org.apache.hc.core5.http2.ssl.ConscryptServerTlsStrategy

- All Implemented Interfaces:
    TlsStrategy

      public class ConscryptServerTlsStrategy
      extends Object
      implements TlsStrategy

  Basic side-side implementation of `TlsStrategy` that upgrades to TLS for endpoints with the specified local ports.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConscryptServerTlsStrategy(SSLContext sslContext)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, int... securePorts)` Deprecated. Use `ConscryptServerTlsStrategy(SSLContext)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy)` Deprecated. Use `ConscryptServerTlsStrategy(SSLContext)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)` Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLBufferMode, SSLSessionInitializer, SSLSessionVerifier)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionInitializer initializer, SSLSessionVerifier verifier)` Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLSessionInitializer, SSLSessionVerifier)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionVerifier verifier)` Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLSessionVerifier)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier)`
    `ConscryptServerTlsStrategy(SSLContext sslContext, SSLSessionVerifier verifier)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `upgrade(TransportSecurityLayer tlsSession, HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, Timeout handshakeTimeout)` Secures current session layer with TLS security.

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

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

- - ### Constructor Detail

    - #### ConscryptServerTlsStrategy

          @Deprecated
          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                               SecurePortStrategy securePortStrategy,
                                               SSLBufferMode sslBufferMode,
                                               SSLSessionInitializer initializer,
                                               SSLSessionVerifier verifier)

      Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLBufferMode, SSLSessionInitializer, SSLSessionVerifier)`

    - #### ConscryptServerTlsStrategy

          @Deprecated
          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                               SecurePortStrategy securePortStrategy,
                                               SSLSessionInitializer initializer,
                                               SSLSessionVerifier verifier)

      Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLSessionInitializer, SSLSessionVerifier)`

    - #### ConscryptServerTlsStrategy

          @Deprecated
          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                               SecurePortStrategy securePortStrategy,
                                               SSLSessionVerifier verifier)

      Deprecated. Use `ConscryptServerTlsStrategy(SSLContext, SSLSessionVerifier)`

    - #### ConscryptServerTlsStrategy

          @Deprecated
          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                               SecurePortStrategy securePortStrategy)

      Deprecated. Use `ConscryptServerTlsStrategy(SSLContext)`

    - #### ConscryptServerTlsStrategy

          @Deprecated
          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                               int... securePorts)

      Deprecated. Use `ConscryptServerTlsStrategy(SSLContext)`

    - #### ConscryptServerTlsStrategy

          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                    SSLBufferMode sslBufferMode,
                                    SSLSessionInitializer initializer,
                                    SSLSessionVerifier verifier)

    - #### ConscryptServerTlsStrategy

          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                    SSLSessionInitializer initializer,
                                    SSLSessionVerifier verifier)

    - #### ConscryptServerTlsStrategy

          public ConscryptServerTlsStrategy(SSLContext sslContext,
                                    SSLSessionVerifier verifier)

    - #### ConscryptServerTlsStrategy

          public ConscryptServerTlsStrategy(SSLContext sslContext)

  - ### Method Detail

    - #### upgrade

          public boolean upgrade(TransportSecurityLayer tlsSession,
                        HttpHost host,
                        SocketAddress localAddress,
                        SocketAddress remoteAddress,
                        Object attachment,
                        Timeout handshakeTimeout)

      Description copied from interface: `TlsStrategy`
      Secures current session layer with TLS security.
      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.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.