Package io.quarkus.keycloak.pep.runtime
Class HttpClientBuilder
- java.lang.Object
-
- io.quarkus.keycloak.pep.runtime.HttpClientBuilder
-
public class HttpClientBuilder extends Object
Creates aHttpClient
based on anAdapterConfig
. This is the same code from the Keycloakorg.keycloak.adapters.HttpClientBuilder
class but without using Keycloak Adapter API/SPI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpClientBuilder.HostnameVerificationPolicy
(package private) static class
HttpClientBuilder.VerifierWrapper
-
Field Summary
Fields Modifier and Type Field Description protected KeyStore
clientKeyStore
protected String
clientPrivateKeyPassword
protected int
connectionPoolSize
protected long
connectionTTL
protected TimeUnit
connectionTTLUnit
protected boolean
disableCookieCache
protected boolean
disableTrustManager
protected long
establishConnectionTimeout
protected TimeUnit
establishConnectionTimeoutUnits
protected int
maxPooledPerRoute
protected HttpClientBuilder.HostnameVerificationPolicy
policy
protected org.apache.http.HttpHost
proxyHost
protected long
socketTimeout
protected TimeUnit
socketTimeoutUnits
protected SSLContext
sslContext
protected KeyStore
truststore
protected HostnameVerifier
verifier
-
Constructor Summary
Constructors Constructor Description HttpClientBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.client.HttpClient
build()
org.apache.http.client.HttpClient
build(org.keycloak.representations.adapters.config.AdapterHttpClientConfig adapterConfig)
HttpClientBuilder
connectionPoolSize(int connectionPoolSize)
HttpClientBuilder
connectionTTL(long ttl, TimeUnit unit)
HttpClientBuilder
disableCookieCache(boolean disable)
HttpClientBuilder
disableTrustManager()
Disable trust management and hostname verification.HttpClientBuilder
establishConnectionTimeout(long timeout, TimeUnit unit)
When trying to make an initial socket connection, what is the timeout?HttpClientBuilder
hostnameVerification(HttpClientBuilder.HostnameVerificationPolicy policy)
SSL policy used to verify hostnamesHttpClientBuilder
keyStore(KeyStore keyStore, char[] password)
HttpClientBuilder
keyStore(KeyStore keyStore, String password)
HttpClientBuilder
maxPooledPerRoute(int maxPooledPerRoute)
HttpClientBuilder
socketTimeout(long timeout, TimeUnit unit)
Socket inactivity timeoutHttpClientBuilder
spNegoSchemeFactory(org.apache.http.impl.auth.SPNegoSchemeFactory spnegoSchemeFactory)
HttpClientBuilder
sslContext(SSLContext sslContext)
HttpClientBuilder
trustStore(KeyStore truststore)
HttpClientBuilder
useSPNego(boolean useSpnego)
-
-
-
Field Detail
-
truststore
protected KeyStore truststore
-
clientKeyStore
protected KeyStore clientKeyStore
-
clientPrivateKeyPassword
protected String clientPrivateKeyPassword
-
disableTrustManager
protected boolean disableTrustManager
-
disableCookieCache
protected boolean disableCookieCache
-
policy
protected HttpClientBuilder.HostnameVerificationPolicy policy
-
sslContext
protected SSLContext sslContext
-
connectionPoolSize
protected int connectionPoolSize
-
maxPooledPerRoute
protected int maxPooledPerRoute
-
connectionTTL
protected long connectionTTL
-
connectionTTLUnit
protected TimeUnit connectionTTLUnit
-
verifier
protected HostnameVerifier verifier
-
socketTimeout
protected long socketTimeout
-
socketTimeoutUnits
protected TimeUnit socketTimeoutUnits
-
establishConnectionTimeout
protected long establishConnectionTimeout
-
establishConnectionTimeoutUnits
protected TimeUnit establishConnectionTimeoutUnits
-
proxyHost
protected org.apache.http.HttpHost proxyHost
-
-
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:
-
connectionTTL
public HttpClientBuilder connectionTTL(long ttl, 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.
-
disableCookieCache
public HttpClientBuilder disableCookieCache(boolean disable)
-
hostnameVerification
public HttpClientBuilder hostnameVerification(HttpClientBuilder.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)
-
spNegoSchemeFactory
public HttpClientBuilder spNegoSchemeFactory(org.apache.http.impl.auth.SPNegoSchemeFactory spnegoSchemeFactory)
-
useSPNego
public HttpClientBuilder useSPNego(boolean useSpnego)
-
build
public org.apache.http.client.HttpClient build()
-
build
public org.apache.http.client.HttpClient build(org.keycloak.representations.adapters.config.AdapterHttpClientConfig adapterConfig)
-
-