Package com.exasol.bucketfs.http
Class HttpClientBuilder
- java.lang.Object
-
- com.exasol.bucketfs.http.HttpClientBuilder
-
public class HttpClientBuilder extends Object
A builder forHttpClientthat provides a convenient way for ignoring TLS errors.
-
-
Constructor Summary
Constructors Constructor Description HttpClientBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClientbuild()Creates a newHttpClientusing the specified configuration.HttpClientBuildercertificate(X509Certificate certificate)Use the given certificate for TLS connections.HttpClientBuilderraiseTlsErrors(boolean raiseTlsErrors)Define if TLS errors should raise an error when executing requests or if they should be ignored.
-
-
-
Method Detail
-
raiseTlsErrors
public HttpClientBuilder raiseTlsErrors(boolean raiseTlsErrors)
Define if TLS errors should raise an error when executing requests or if they should be ignored. Setting this tofalseis required as the docker-db uses a self-signed certificate.Defaults to raise TLS errors.
Setting this to
falseis mutually exclusive withcertificate.- Parameters:
raiseTlsErrors-trueif theCommandFactoryshould fail for TLS errors,falseif it should ignore TLS errors.- Returns:
- this instance for method chaining
-
certificate
public HttpClientBuilder certificate(X509Certificate certificate)
Use the given certificate for TLS connections.Defaults to using the certificates from the JVMs default key store.
Mutually exclusive with setting
raiseTlsErrorstofalse.- Parameters:
certificate- certificate to use- Returns:
- this instance for method chaining
-
build
public HttpClient build()
Creates a newHttpClientusing the specified configuration.- Returns:
- a new
HttpClient
-
-