org.apache.hc.client5.http.ssl

## Interface TlsSocketStrategy

- All Known Implementing Classes:
    ConscryptClientTlsStrategy, DefaultClientTlsStrategy

      @Contract(threading=STATELESS)
      public interface TlsSocketStrategy

  TLS protocol upgrade strategy for blocking `Socket`s.
  Since:
    5.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.

- - ### Method Detail

    - #### upgrade

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

      Upgrades the given plain socket and executes the TLS handshake over it.
      Parameters:
        `socket` - the existing plain socket
        `target` - the name of the target host.
        `port` - the port to connect to on the target host.
        `context` - the actual HTTP context.
        `attachment` - connect request attachment.
      Returns:
        socket upgraded to TLS.
      Throws:
        `IOException`

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