Package org.wildfly.security.http.oidc
Class HttpClientBuilder
- java.lang.Object
-
- org.wildfly.security.http.oidc.HttpClientBuilder
-
public class HttpClientBuilder extends Object
Abstraction for creating HttpClients. Allows SSL configuration.- Author:
- Bill Burke, Farah Juma
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpClientBuilder.HostnameVerificationPolicy
private static class
HttpClientBuilder.PassthroughTrustManager
(package private) static class
HttpClientBuilder.VerifierWrapper
-
Field Summary
Fields Modifier and Type Field Description private KeyStore
clientKeyStore
private String
clientPrivateKeyPassword
private int
connectionPoolSize
private long
connectionTimeToLive
private TimeUnit
connectionTimeToLiveUnit
private boolean
disableCookieCache
private boolean
disableTrustManager
private long
establishConnectionTimeout
private TimeUnit
establishConnectionTimeoutUnits
protected int
maxPooledPerRoute
private HttpClientBuilder.HostnameVerificationPolicy
policy
private org.apache.http.HttpHost
proxyHost
private long
socketTimeout
private TimeUnit
socketTimeoutUnits
private SSLContext
sslContext
private KeyStore
truststore
private HostnameVerifier
verifier
-
Constructor Summary
Constructors Constructor Description HttpClientBuilder()
-
Method Summary
-
-
-
Field Detail
-
truststore
private KeyStore truststore
-
disableTrustManager
private boolean disableTrustManager
-
disableCookieCache
private boolean disableCookieCache
-
clientKeyStore
private KeyStore clientKeyStore
-
clientPrivateKeyPassword
private String clientPrivateKeyPassword
-
connectionPoolSize
private int connectionPoolSize
-
maxPooledPerRoute
protected int maxPooledPerRoute
-
policy
private HttpClientBuilder.HostnameVerificationPolicy policy
-
proxyHost
private org.apache.http.HttpHost proxyHost
-
verifier
private HostnameVerifier verifier
-
sslContext
private SSLContext sslContext
-
connectionTimeToLive
private long connectionTimeToLive
-
connectionTimeToLiveUnit
private TimeUnit connectionTimeToLiveUnit
-
socketTimeout
private long socketTimeout
-
socketTimeoutUnits
private TimeUnit socketTimeoutUnits
-
establishConnectionTimeout
private long establishConnectionTimeout
-
establishConnectionTimeoutUnits
private TimeUnit establishConnectionTimeoutUnits
-
-
Method Detail
-
setDisableTrustManager
public HttpClientBuilder setDisableTrustManager()
This should only be set if you cannot or do not want to verify the identity of the host you are communicating with.- Returns:
- the builder
-
setDisableCookieCache
public HttpClientBuilder setDisableCookieCache(boolean disable)
-
setKeyStore
public HttpClientBuilder setKeyStore(KeyStore keyStore, String password)
-
setConnectionPoolSize
public HttpClientBuilder setConnectionPoolSize(int connectionPoolSize)
-
setHostnameVerification
public HttpClientBuilder setHostnameVerification(HttpClientBuilder.HostnameVerificationPolicy policy)
-
setTrustStore
public HttpClientBuilder setTrustStore(KeyStore truststore)
-
setConnectionTimeToLive
public HttpClientBuilder setConnectionTimeToLive(long timeToLive, TimeUnit timeToLiveUnit)
-
setMaxPooledPerRoute
public HttpClientBuilder setMaxPooledPerRoute(int maxPooledPerRoute)
-
setSocketTimeout
public HttpClientBuilder setSocketTimeout(long timeout, TimeUnit unit)
-
setEstablishConnectionTimeout
public HttpClientBuilder setEstablishConnectionTimeout(long timeout, TimeUnit unit)
-
build
public org.apache.http.client.HttpClient build()
-
build
public org.apache.http.client.HttpClient build(OidcJsonConfiguration oidcClientConfig)
-
configureProxyForAuthServerIfProvided
private void configureProxyForAuthServerIfProvided(OidcJsonConfiguration adapterConfig)
Configures a the proxy to use for auth-server requests if provided.If the given
OidcJsonConfiguration
contains the attributeproxy-url
we use the given URL as a proxy server, otherwise the proxy configuration is ignored.- Parameters:
adapterConfig
-
-
-