Class HttpClientSecurityParameters
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.http.client.AuthCache
HttpClientAuthCache
to allow pre-emptive authentication.private X509Credential
The X509 credential used for client TLS.private org.apache.http.client.CredentialsProvider
HttpClient credentials provider.private HostnameVerifier
The hostname verifier.private Boolean
Flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.TLS cipher suites.private CriteriaSet
Optional criteria set used in evaluating server TLS credentials.TLS Protocols.private TrustEngine<? super X509Credential>
Optional trust engine used in evaluating server TLS credentials. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.client.AuthCache
Get an instance ofAuthCache
used for authentication by the HttpClient instance.Get the optional client TLS credential.org.apache.http.client.CredentialsProvider
Get an instance ofCredentialsProvider
used for authentication by the HttpClient instance.Get the optional hostname verifier.Get the optional list of TLS cipher suites.Get the optional criteria set used in evaluating server TLS credentials.Get the optional list of TLS protocols.TrustEngine<? super X509Credential>
Sets the optional trust engine used in evaluating server TLS credentials.Get the flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.void
setAuthCache
(org.apache.http.client.AuthCache cache) Set an instance ofAuthCache
used for authentication by the HttpClient instance.void
setBasicCredentials
(org.apache.http.auth.UsernamePasswordCredentials credentials) A convenience method to set a (single) username and password used for BASIC authentication.void
setBasicCredentialsWithScope
(org.apache.http.auth.UsernamePasswordCredentials credentials, org.apache.http.auth.AuthScope scope) A convenience method to set a (single) username and password used for BASIC authentication.void
setClientTLSCredential
(X509Credential credential) Set the optional client TLS credential.void
setCredentialsProvider
(org.apache.http.client.CredentialsProvider provider) Set an instance ofCredentialsProvider
used for authentication by the HttpClient instance.void
setHostnameVerifier
(HostnameVerifier verifier) Set the optional hostname verifier.void
Set the flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.void
setTLSCipherSuites
(Collection<String> cipherSuites) Set the optional list of TLS cipher suites.void
setTLSCriteriaSet
(CriteriaSet criteriaSet) Set the optional criteria set used in evaluating server TLS credentials.void
setTLSProtocols
(Collection<String> protocols) Set the optional list of TLS protocols.void
setTLSTrustEngine
(TrustEngine<? super X509Credential> engine) Sets the optional trust engine used in evaluating server TLS credentials.
-
Field Details
-
credentialsProvider
@Nullable private org.apache.http.client.CredentialsProvider credentialsProviderHttpClient credentials provider. -
authCache
@Nullable private org.apache.http.client.AuthCache authCacheHttpClientAuthCache
to allow pre-emptive authentication. -
tlsTrustEngine
Optional trust engine used in evaluating server TLS credentials. -
tlsCriteriaSet
Optional criteria set used in evaluating server TLS credentials. -
tlsProtocols
TLS Protocols. -
tlsCipherSuites
TLS cipher suites. -
hostnameVerifier
The hostname verifier. -
clientTLSCredential
The X509 credential used for client TLS. -
serverTLSFailureFatal
Flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.
-
-
Constructor Details
-
HttpClientSecurityParameters
public HttpClientSecurityParameters()
-
-
Method Details
-
getCredentialsProvider
@Nullable public org.apache.http.client.CredentialsProvider getCredentialsProvider()Get an instance ofCredentialsProvider
used for authentication by the HttpClient instance.- Returns:
- the credentials provider, or null
-
setCredentialsProvider
public void setCredentialsProvider(@Nullable org.apache.http.client.CredentialsProvider provider) Set an instance ofCredentialsProvider
used for authentication by the HttpClient instance.- Parameters:
provider
- the credentials provider
-
getAuthCache
@Nullable public org.apache.http.client.AuthCache getAuthCache()Get an instance ofAuthCache
used for authentication by the HttpClient instance.- Returns:
- the cache, or null
- Since:
- 3.4.0
-
setAuthCache
public void setAuthCache(@Nullable org.apache.http.client.AuthCache cache) Set an instance ofAuthCache
used for authentication by the HttpClient instance.- Parameters:
cache
- the auth cache- Since:
- 3.4.0
-
setBasicCredentials
public void setBasicCredentials(@Nullable org.apache.http.auth.UsernamePasswordCredentials credentials) A convenience method to set a (single) username and password used for BASIC authentication. To disable BASIC authentication pass null for the credentials instance.An
AuthScope
will be generated which specifies any host, port, scheme and realm.To specify multiple usernames and passwords for multiple host, port, scheme, and realm combinations, instead provide an instance of
CredentialsProvider
viasetCredentialsProvider(CredentialsProvider)
.- Parameters:
credentials
- the username and password credentials
-
setBasicCredentialsWithScope
public void setBasicCredentialsWithScope(@Nullable org.apache.http.auth.UsernamePasswordCredentials credentials, @Nullable org.apache.http.auth.AuthScope scope) A convenience method to set a (single) username and password used for BASIC authentication. To disable BASIC authentication pass null for the credentials instance.If the
authScope
is null, anAuthScope
will be generated which specifies any host, port, scheme and realm.To specify multiple usernames and passwords for multiple host, port, scheme, and realm combinations, instead provide an instance of
CredentialsProvider
viasetCredentialsProvider(CredentialsProvider)
.- Parameters:
credentials
- the username and password credentialsscope
- the HTTP client auth scope with which to scope the credentials, may be null
-
getTLSTrustEngine
Sets the optional trust engine used in evaluating server TLS credentials.- Returns:
- the trust engine instance to use, or null
-
setTLSTrustEngine
Sets the optional trust engine used in evaluating server TLS credentials.- Parameters:
engine
- the trust engine instance to use
-
getTLSCriteriaSet
Get the optional criteria set used in evaluating server TLS credentials.- Returns:
- the criteria set instance to use
-
setTLSCriteriaSet
Set the optional criteria set used in evaluating server TLS credentials.- Parameters:
criteriaSet
- the new criteria set instance to use
-
getTLSProtocols
Get the optional list of TLS protocols.- Returns:
- the TLS protocols, or null
-
setTLSProtocols
Set the optional list of TLS protocols.- Parameters:
protocols
- the TLS protocols or null
-
getTLSCipherSuites
Get the optional list of TLS cipher suites.- Returns:
- the list of TLS cipher suites, or null
-
setTLSCipherSuites
Set the optional list of TLS cipher suites.- Parameters:
cipherSuites
- the TLS cipher suites, or null
-
getHostnameVerifier
Get the optional hostname verifier.- Returns:
- the hostname verifier, or null
-
setHostnameVerifier
Set the optional hostname verifier.- Parameters:
verifier
- the hostname verifier, or null
-
getClientTLSCredential
Get the optional client TLS credential.- Returns:
- the client TLS credential, or null
-
setClientTLSCredential
Set the optional client TLS credential.- Parameters:
credential
- the client TLS credential, or null
-
isServerTLSFailureFatal
Get the flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.Note: a
Boolean
is used here rather thanboolean
to explicitly allow a non-configured value, allowing consuming components to implement their own internal defaults.- Returns:
- true if fatal, false if non-fatal, null if not explicitly configured
-
setServerTLSFailureFatal
Set the flag indicating whether failure of server TLS trust engine evaluation should be treated as a fatal error.Note: a
Boolean
is used here rather thanboolean
to explicitly allow a non-configured value, allowing consuming components to implement their own internal defaults.- Parameters:
flag
- true if fatal, false if non-fatal, null if not explicitly configured
-