public class BasicHttpClientSecurityConfiguration extends Object implements HttpClientSecurityConfiguration
HttpClientSecurityConfiguration.| Modifier and Type | Field and Description |
|---|---|
private X509Credential |
clientTLSCredential
The X509 credential used for client TLS.
|
private CredentialsProvider |
credentialsProvider
HttpClient credentials provider.
|
private X509HostnameVerifier |
hostnameVerifier
The hostname verifier.
|
private Boolean |
serverTLSFailureFatal
Flag indicating whether failure of server TLS trust engine evaluation should be treated as
a fatal error.
|
private List<String> |
tlsCipherSuites
TLS cipher suites.
|
private List<String> |
tlsProtocols
TLS Protocols.
|
private TrustEngine<? super X509Credential> |
tlsTrustEngine
Optional trust engine used in evaluating server TLS credentials.
|
| Constructor and Description |
|---|
BasicHttpClientSecurityConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
X509Credential |
getClientTLSCredential()
Get the optional client TLS credential.
|
CredentialsProvider |
getCredentialsProvider()
Get an instance of
CredentialsProvider used for authentication by the HttpClient instance. |
X509HostnameVerifier |
getHostnameVerifier()
Get the optional hostname verifier.
|
List<String> |
getTLSCipherSuites()
Get the optional list of TLS cipher suites.
|
List<String> |
getTLSProtocols()
Get the optional list of TLS protocols.
|
TrustEngine<? super X509Credential> |
getTLSTrustEngine()
Sets the optional trust engine used in evaluating server TLS credentials.
|
Boolean |
isServerTLSFailureFatal()
Get the flag indicating whether failure of server TLS trust engine evaluation should be treated as
a fatal error.
|
void |
setBasicCredentials(UsernamePasswordCredentials credentials)
A convenience method to set a (single) username and password used for BASIC authentication.
|
void |
setBasicCredentialsWithScope(UsernamePasswordCredentials credentials,
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(CredentialsProvider provider)
Set an instance of
CredentialsProvider used for authentication by the HttpClient instance. |
void |
setHostnameVerifier(X509HostnameVerifier verifier)
Set the optional hostname verifier.
|
void |
setServerTLSFailureFatal(Boolean flag)
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 |
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.
|
@Nullable private CredentialsProvider credentialsProvider
@Nullable private TrustEngine<? super X509Credential> tlsTrustEngine
@Nullable private X509HostnameVerifier hostnameVerifier
@Nullable private X509Credential clientTLSCredential
public BasicHttpClientSecurityConfiguration()
@Nullable public CredentialsProvider getCredentialsProvider()
CredentialsProvider used for authentication by the HttpClient instance.getCredentialsProvider in interface HttpClientSecurityConfigurationpublic void setCredentialsProvider(@Nullable CredentialsProvider provider)
CredentialsProvider used for authentication by the HttpClient instance.provider - the credentials providerpublic void setBasicCredentials(@Nullable UsernamePasswordCredentials credentials)
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 via setCredentialsProvider(CredentialsProvider).
credentials - the username and password credentialspublic void setBasicCredentialsWithScope(@Nullable UsernamePasswordCredentials credentials, @Nullable AuthScope scope)
If the authScope is null, 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 via setCredentialsProvider(CredentialsProvider).
credentials - the username and password credentialsscope - the HTTP client auth scope with which to scope the credentials, may be null@Nullable public TrustEngine<? super X509Credential> getTLSTrustEngine()
getTLSTrustEngine in interface HttpClientSecurityConfigurationpublic void setTLSTrustEngine(@Nullable TrustEngine<? super X509Credential> engine)
engine - the trust engine instance to use@Nullable public List<String> getTLSProtocols()
getTLSProtocols in interface HttpClientSecurityConfigurationpublic void setTLSProtocols(@Nullable Collection<String> protocols)
protocols - the TLS protocols or null@Nullable public List<String> getTLSCipherSuites()
getTLSCipherSuites in interface HttpClientSecurityConfigurationpublic void setTLSCipherSuites(@Nullable Collection<String> cipherSuites)
cipherSuites - the TLS cipher suites, or null@Nullable public X509HostnameVerifier getHostnameVerifier()
getHostnameVerifier in interface HttpClientSecurityConfigurationpublic void setHostnameVerifier(@Nullable X509HostnameVerifier verifier)
verifier - the hostname verifier, or null@Nullable public X509Credential getClientTLSCredential()
getClientTLSCredential in interface HttpClientSecurityConfigurationpublic void setClientTLSCredential(@Nullable X509Credential credential)
credential - the client TLS credential, or null@Nullable public Boolean isServerTLSFailureFatal()
Note: a Boolean is used here rather than boolean to explicitly allow a
non-configured value, allowing consuming components to implement their own internal defaults.
isServerTLSFailureFatal in interface HttpClientSecurityConfigurationpublic void setServerTLSFailureFatal(@Nullable Boolean flag)
Note: a Boolean is used here rather than boolean to explicitly allow a
non-configured value, allowing consuming components to implement their own internal defaults.
flag - true if fatal, false if non-fatal, null if not explicitly configuredCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.