public final class HttpClientSecuritySupport extends Object
HttpClient
security features.Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG
Logger.
|
Modifier | Constructor and Description |
---|---|
private |
HttpClientSecuritySupport()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultTLSTrustEngineCriteria(HttpClientContext context,
HttpUriRequest request)
Add default trust engine criteria for TLS usage to the
HttpClientContext . |
static void |
checkTLSCredentialEvaluated(HttpClientContext context,
String scheme)
Check that trust engine evaluation of the server TLS credential was actually performed when the
scheme is HTTPS.
|
static void |
marshalSecurityParameters(HttpClientContext context,
HttpClientSecurityParameters securityParameters)
Marshal the supplied
HttpClientSecurityParameters to the supplied HttpClientContext . |
static void |
marshalSecurityParameters(HttpClientContext context,
HttpClientSecurityParameters securityParameters,
boolean replace)
Marshal the supplied
HttpClientSecurityParameters to the supplied HttpClientContext . |
static void |
setContextValue(HttpClientContext context,
String attributeName,
Object attributeValue,
boolean replace)
Set the supplied attribute value in the client context.
|
public static void addDefaultTLSTrustEngineCriteria(@Nonnull HttpClientContext context, @Nonnull HttpUriRequest request)
HttpClientContext
.context
- the current HTTP context instance in userequest
- the current HTTP requestpublic static void checkTLSCredentialEvaluated(@Nonnull HttpClientContext context, @Nonnull String scheme) throws SSLPeerUnverifiedException
context
- the current HTTP context instance in usescheme
- the HTTP request schemeSSLPeerUnverifiedException
- thrown if the TLS credential was not actually evaluated by the trust enginepublic static void marshalSecurityParameters(@Nonnull HttpClientContext context, @Nullable HttpClientSecurityParameters securityParameters)
HttpClientSecurityParameters
to the supplied HttpClientContext
.
Existing context values will NOT be replaced by non-null parameter values.
context
- the client context instancesecurityParameters
- the security parameters instancepublic static void marshalSecurityParameters(@Nonnull HttpClientContext context, @Nullable HttpClientSecurityParameters securityParameters, boolean replace)
HttpClientSecurityParameters
to the supplied HttpClientContext
.context
- the client context instancesecurityParameters
- the security parameters instancereplace
- whether a non-null security parameter value should replace an existing context valuepublic static void setContextValue(@Nonnull HttpClientContext context, @Nonnull String attributeName, @Nullable Object attributeValue, boolean replace)
context
- the client context instanceattributeName
- the context attribute name toattributeValue
- the context attribute value to set, may be nullreplace
- whether a non-null argument value should replace an existing context valueCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.