Class HttpClientBuilder

java.lang.Object
org.keycloak.connections.httpclient.HttpClientBuilder

public class HttpClientBuilder extends Object
Abstraction for creating HttpClients. Allows SSL configuration.
Version:
$Revision: 1 $
Author:
Bill Burke
  • Field Details

    • truststore

      protected KeyStore truststore
    • clientKeyStore

      protected KeyStore clientKeyStore
    • clientPrivateKeyPassword

      protected String clientPrivateKeyPassword
    • disableTrustManager

      protected boolean disableTrustManager
    • policy

      protected HostnameVerificationPolicy policy
    • sslContext

      protected SSLContext sslContext
    • connectionPoolSize

      protected int connectionPoolSize
    • maxPooledPerRoute

      protected int maxPooledPerRoute
    • connectionTTL

      protected long connectionTTL
    • reuseConnections

      protected boolean reuseConnections
    • connectionTTLUnit

      protected TimeUnit connectionTTLUnit
    • maxConnectionIdleTime

      protected long maxConnectionIdleTime
    • maxConnectionIdleTimeUnit

      protected TimeUnit maxConnectionIdleTimeUnit
    • verifier

      protected HostnameVerifier verifier
    • socketTimeout

      protected long socketTimeout
    • socketTimeoutUnits

      protected TimeUnit socketTimeoutUnits
    • establishConnectionTimeout

      protected long establishConnectionTimeout
    • establishConnectionTimeoutUnits

      protected TimeUnit establishConnectionTimeoutUnits
    • disableCookies

      protected boolean disableCookies
    • proxyMappings

      protected ProxyMappings proxyMappings
    • expectContinueEnabled

      protected boolean expectContinueEnabled
  • Constructor Details

    • HttpClientBuilder

      public HttpClientBuilder()
  • Method Details

    • socketTimeout

      public HttpClientBuilder socketTimeout(long timeout, TimeUnit unit)
      Socket inactivity timeout
      Parameters:
      timeout -
      unit -
      Returns:
    • establishConnectionTimeout

      public HttpClientBuilder establishConnectionTimeout(long timeout, TimeUnit unit)
      When trying to make an initial socket connection, what is the timeout?
      Parameters:
      timeout -
      unit -
      Returns:
    • connectionTTL

      public HttpClientBuilder connectionTTL(long ttl, TimeUnit unit)
    • reuseConnections

      public HttpClientBuilder reuseConnections(boolean reuseConnections)
    • maxConnectionIdleTime

      public HttpClientBuilder maxConnectionIdleTime(long maxConnectionIdleTime, TimeUnit unit)
    • maxPooledPerRoute

      public HttpClientBuilder maxPooledPerRoute(int maxPooledPerRoute)
    • connectionPoolSize

      public HttpClientBuilder connectionPoolSize(int connectionPoolSize)
    • disableTrustManager

      public HttpClientBuilder disableTrustManager()
      Disable trust management and hostname verification. NOTE this is a security hole, so only set this option if you cannot or do not want to verify the identity of the host you are communicating with.
    • disableCookies

      public HttpClientBuilder disableCookies(boolean disable)
      Disable cookie management.
    • hostnameVerification

      public HttpClientBuilder hostnameVerification(HostnameVerificationPolicy policy)
      SSL policy used to verify hostnames
      Parameters:
      policy -
      Returns:
    • sslContext

      public HttpClientBuilder sslContext(SSLContext sslContext)
    • trustStore

      public HttpClientBuilder trustStore(KeyStore truststore)
    • keyStore

      public HttpClientBuilder keyStore(KeyStore keyStore, String password)
    • keyStore

      public HttpClientBuilder keyStore(KeyStore keyStore, char[] password)
    • proxyMappings

      public HttpClientBuilder proxyMappings(ProxyMappings proxyMappings)
    • expectContinueEnabled

      public HttpClientBuilder expectContinueEnabled(boolean expectContinueEnabled)
    • build

      public org.apache.http.impl.client.CloseableHttpClient build()