org.apache.hc.client5.http.ssl

## Class SSLConnectionSocketFactoryBuilder

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

-     public class SSLConnectionSocketFactoryBuilder
      extends Object

  Builder for `SSLConnectionSocketFactory` 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
    `SSLConnectionSocketFactoryBuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SSLConnectionSocketFactory` | `build()`
    `static SSLConnectionSocketFactoryBuilder` | `create()`
    `SSLConnectionSocketFactoryBuilder` | `setCiphers(String... ciphers)` Assigns enabled ciphers.
    `SSLConnectionSocketFactoryBuilder` | `setHostnameVerifier(HostnameVerifier hostnameVerifier)` Assigns `HostnameVerifier` instance.
    `SSLConnectionSocketFactoryBuilder` | `setSslContext(SSLContext sslContext)` Assigns `SSLContext` instance.
    `SSLConnectionSocketFactoryBuilder` | `setTlsVersions(String... tlslVersions)` Assigns enabled `TLS` versions.
    `SSLConnectionSocketFactoryBuilder` | `setTlsVersions(org.apache.hc.core5.http.ssl.TLS... tlslVersions)` Assigns enabled `TLS` versions.
    `SSLConnectionSocketFactoryBuilder` | `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

    - #### SSLConnectionSocketFactoryBuilder

          public SSLConnectionSocketFactoryBuilder()

  - ### Method Detail

    - #### create

          public static SSLConnectionSocketFactoryBuilder create()

    - #### setSslContext

          public SSLConnectionSocketFactoryBuilder setSslContext(SSLContext sslContext)

      Assigns `SSLContext` instance.

    - #### setTlsVersions

          public final SSLConnectionSocketFactoryBuilder setTlsVersions(String... tlslVersions)

      Assigns enabled `TLS` versions.

    - #### setTlsVersions

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

      Assigns enabled `TLS` versions.

    - #### setCiphers

          public final SSLConnectionSocketFactoryBuilder setCiphers(String... ciphers)

      Assigns enabled ciphers.

    - #### setHostnameVerifier

          public SSLConnectionSocketFactoryBuilder setHostnameVerifier(HostnameVerifier hostnameVerifier)

      Assigns `HostnameVerifier` instance.

    - #### useSystemProperties

          public final SSLConnectionSocketFactoryBuilder useSystemProperties()

      Use system properties when creating and configuring default implementations.

    - #### build

          public SSLConnectionSocketFactory build()

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