org.apache.hc.core5.http.nio.ssl

## Class BasicServerTlsStrategy

- java.lang.Object
- - org.apache.hc.core5.http.nio.ssl.BasicServerTlsStrategy

- All Implemented Interfaces:
    TlsStrategy

      public class BasicServerTlsStrategy
      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
    `BasicServerTlsStrategy()`
    `BasicServerTlsStrategy(SecurePortStrategy securePortStrategy)` Deprecated. Use `BasicServerTlsStrategy()`
    `BasicServerTlsStrategy(SSLContext sslContext)`
    `BasicServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy)` Deprecated. Use `BasicServerTlsStrategy(SSLContext)`
    `BasicServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)` Deprecated. Use `BasicServerTlsStrategy(SSLContext, SSLBufferMode, SSLSessionInitializer, SSLSessionVerifier)`
    `BasicServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionInitializer initializer, SSLSessionVerifier verifier)` Deprecated. Use `BasicServerTlsStrategy(SSLContext, SSLSessionInitializer, SSLSessionVerifier)`
    `BasicServerTlsStrategy(SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionVerifier verifier)` Deprecated. Use `BasicServerTlsStrategy(SSLContext, SSLSessionVerifier)`
    `BasicServerTlsStrategy(SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)`
    `BasicServerTlsStrategy(SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier)`
    `BasicServerTlsStrategy(SSLContext sslContext, SSLSessionVerifier verifier)`
    `BasicServerTlsStrategy(SSLSessionVerifier verifier)` Constructor with the default SSL context based on system properties and custom `SSLSessionVerifier` verifier.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `upgrade(TransportSecurityLayer tlsSession, HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, Timeout handshakeTimeout)` Deprecated. use `upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)`
    `void` | `upgrade(TransportSecurityLayer tlsSession, NamedEndpoint endpoint, Object attachment, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback)` Secures current session layer with TLS.

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

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

- - ### Constructor Detail

    - #### BasicServerTlsStrategy

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

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

    - #### BasicServerTlsStrategy

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

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

    - #### BasicServerTlsStrategy

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

      Deprecated. Use `BasicServerTlsStrategy(SSLContext, SSLSessionVerifier)`

    - #### BasicServerTlsStrategy

          @Deprecated
          public BasicServerTlsStrategy(SSLContext sslContext,
                                                    SecurePortStrategy securePortStrategy)

      Deprecated. Use `BasicServerTlsStrategy(SSLContext)`

    - #### BasicServerTlsStrategy

          @Deprecated
          public BasicServerTlsStrategy(SecurePortStrategy securePortStrategy)

      Deprecated. Use `BasicServerTlsStrategy()`

    - #### BasicServerTlsStrategy

          public BasicServerTlsStrategy(SSLSessionVerifier verifier)

      Constructor with the default SSL context based on system properties and custom `SSLSessionVerifier` verifier.
      Parameters:
        `verifier` - the custom `SSLSessionVerifier`.
      Since:
        5.2

    - #### BasicServerTlsStrategy

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

    - #### BasicServerTlsStrategy

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

    - #### BasicServerTlsStrategy

          public BasicServerTlsStrategy(SSLContext sslContext,
                                        SSLSessionVerifier verifier)

    - #### BasicServerTlsStrategy

          public BasicServerTlsStrategy(SSLContext sslContext)

    - #### BasicServerTlsStrategy

          public BasicServerTlsStrategy()

  - ### Method Detail

    - #### upgrade

          public void upgrade(TransportSecurityLayer tlsSession,
                              NamedEndpoint endpoint,
                              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,
                                             SocketAddress localAddress,
                                             SocketAddress remoteAddress,
                                             Object attachment,
                                             Timeout handshakeTimeout)

      Deprecated. use `upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)`
      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.

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