org.apache.hc.client5.http.ssl

## Class ClientTlsStrategyBuilder

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

    public class ClientTlsStrategyBuilder
    extends Object

Builder for client `TlsStrategy` instances.

When a particular component is not explicitly set this class will use its default implementation. System properties will be taken into account when configuring the default implementations when `useSystemProperties()` method is called prior to calling `build()`.

- ssl.TrustManagerFactory.algorithm
- javax.net.ssl.trustStoreType
- javax.net.ssl.trustStore
- javax.net.ssl.trustStoreProvider
- javax.net.ssl.trustStorePassword
- ssl.KeyManagerFactory.algorithm
- javax.net.ssl.keyStoreType
- javax.net.ssl.keyStore
- javax.net.ssl.keyStoreProvider
- javax.net.ssl.keyStorePassword
- https.protocols
- https.cipherSuites

Since:
  5.0

### Constructor Summary

Constructors
Constructor and Description
`ClientTlsStrategyBuilder()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`org.apache.hc.core5.http.nio.ssl.TlsStrategy` `build()`
`static ClientTlsStrategyBuilder` `create()`
`ClientTlsStrategyBuilder` `setCiphers(String... ciphers)` Sets enabled ciphers.
`void` `setHostnameVerificationPolicy(HostnameVerificationPolicy hostnameVerificationPolicy)` Sets `HostnameVerificationPolicy` value.
`ClientTlsStrategyBuilder` `setHostnameVerifier(HostnameVerifier hostnameVerifier)` Sets `HostnameVerifier` instance.
`ClientTlsStrategyBuilder` `setSslBufferMode(org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode)` Sets `SSLBufferMode` value.
`ClientTlsStrategyBuilder` `setSslContext(SSLContext sslContext)` Sets `SSLContext` instance.
`ClientTlsStrategyBuilder` `setTlsDetailsFactory(org.apache.hc.core5.function.Factory<SSLEngine,org.apache.hc.core5.reactor.ssl.TlsDetails> tlsDetailsFactory)` Deprecated. Do not use. This method has no effect.
`ClientTlsStrategyBuilder` `setTlsVersions(String... tlslVersions)` Sets enabled `TLS` versions.
`ClientTlsStrategyBuilder` `setTlsVersions(org.apache.hc.core5.http.ssl.TLS... tlslVersions)` Sets enabled `TLS` versions.
`ClientTlsStrategyBuilder` `useSystemProperties()` Use system properties when creating and configuring default implementations.

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

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

### Constructor Detail

#### ClientTlsStrategyBuilder

    public ClientTlsStrategyBuilder()

### Method Detail

#### create

    public static ClientTlsStrategyBuilder create()

#### setSslContext

    public ClientTlsStrategyBuilder setSslContext(SSLContext sslContext)

Sets `SSLContext` instance.

Returns:
  this instance.

#### setTlsVersions

    public final ClientTlsStrategyBuilder setTlsVersions(String... tlslVersions)

Sets enabled `TLS` versions.

Returns:
  this instance.

#### setTlsVersions

    public final ClientTlsStrategyBuilder setTlsVersions(org.apache.hc.core5.http.ssl.TLS... tlslVersions)

Sets enabled `TLS` versions.

Returns:
  this instance.

#### setCiphers

    public final ClientTlsStrategyBuilder setCiphers(String... ciphers)

Sets enabled ciphers.

Returns:
  this instance.

#### setSslBufferMode

    public ClientTlsStrategyBuilder setSslBufferMode(org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferMode)

Sets `SSLBufferMode` value.

Returns:
  this instance.

#### setHostnameVerificationPolicy

    public void setHostnameVerificationPolicy(HostnameVerificationPolicy hostnameVerificationPolicy)

Sets `HostnameVerificationPolicy` value.

#### setHostnameVerifier

    public ClientTlsStrategyBuilder setHostnameVerifier(HostnameVerifier hostnameVerifier)

Sets `HostnameVerifier` instance.

Returns:
  this instance.

#### setTlsDetailsFactory

    @Deprecated
    public ClientTlsStrategyBuilder setTlsDetailsFactory(org.apache.hc.core5.function.Factory<SSLEngine,org.apache.hc.core5.reactor.ssl.TlsDetails> tlsDetailsFactory)

Deprecated. Do not use. This method has no effect.
Sets `TlsDetails` `Factory` instance.

Returns:
  this instance.

#### useSystemProperties

    public final ClientTlsStrategyBuilder useSystemProperties()

Use system properties when creating and configuring default implementations.

Returns:
  this instance.

#### build

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