Class HttpClientBuilder


  • public class HttpClientBuilder
    extends Object
    Creates a HttpClient based on an AdapterConfig. This is the same code from the Keycloak org.keycloak.adapters.HttpClientBuilder class but without using Keycloak Adapter API/SPI.
    • Field Detail

      • truststore

        protected KeyStore truststore
      • clientKeyStore

        protected KeyStore clientKeyStore
      • clientPrivateKeyPassword

        protected String clientPrivateKeyPassword
      • disableTrustManager

        protected boolean disableTrustManager
      • disableCookieCache

        protected boolean disableCookieCache
      • connectionPoolSize

        protected int connectionPoolSize
      • maxPooledPerRoute

        protected int maxPooledPerRoute
      • connectionTTL

        protected long connectionTTL
      • connectionTTLUnit

        protected TimeUnit connectionTTLUnit
      • socketTimeout

        protected long socketTimeout
      • socketTimeoutUnits

        protected TimeUnit socketTimeoutUnits
      • establishConnectionTimeout

        protected long establishConnectionTimeout
      • establishConnectionTimeoutUnits

        protected TimeUnit establishConnectionTimeoutUnits
      • proxyHost

        protected org.apache.http.HttpHost proxyHost
    • Constructor Detail

      • HttpClientBuilder

        public HttpClientBuilder()
    • Method Detail

      • 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:
      • 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.
      • disableCookieCache

        public HttpClientBuilder disableCookieCache​(boolean disable)
      • spNegoSchemeFactory

        public HttpClientBuilder spNegoSchemeFactory​(org.apache.http.impl.auth.SPNegoSchemeFactory spnegoSchemeFactory)
      • build

        public org.apache.http.client.HttpClient build()
      • build

        public org.apache.http.client.HttpClient build​(org.keycloak.representations.adapters.config.AdapterHttpClientConfig adapterConfig)