HttpConfiguration.Customizerpublic class SecureRequestCustomizer extends java.lang.Object implements HttpConfiguration.Customizer
Customizer that extracts the attribute from an SSLContext
and sets them on the request with ServletRequest.setAttribute(String, Object)
according to Servlet Specification Requirements.
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CACHED_INFO_ATTR |
The name of the SSLSession attribute that will contain any cached information.
|
| Constructor | Description |
|---|---|
SecureRequestCustomizer() |
|
SecureRequestCustomizer(boolean sniHostCheck) |
|
SecureRequestCustomizer(boolean sniHostCheck,
long stsMaxAgeSeconds,
boolean stsIncludeSubdomains) |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
customize(javax.net.ssl.SSLEngine sslEngine,
Request request) |
Customizes the request attributes to be set for SSL requests.
|
void |
customize(Connector connector,
HttpConfiguration channelConfig,
Request request) |
|
protected void |
customizeSecure(Request request) |
Customizes the request attributes for general secure settings.
|
java.lang.String |
getSslSessionAttribute() |
|
long |
getStsMaxAge() |
|
boolean |
isSniHostCheck() |
|
boolean |
isStsIncludeSubDomains() |
|
void |
setSniHostCheck(boolean sniHostCheck) |
|
void |
setSslSessionAttribute(java.lang.String attribute) |
|
void |
setStsIncludeSubDomains(boolean stsIncludeSubDomains) |
|
void |
setStsMaxAge(long stsMaxAgeSeconds) |
Set the Strict-Transport-Security max age.
|
void |
setStsMaxAge(long period,
java.util.concurrent.TimeUnit units) |
Convenience method to call
setStsMaxAge(long) |
java.lang.String |
toString() |
public static final java.lang.String CACHED_INFO_ATTR
public SecureRequestCustomizer()
public SecureRequestCustomizer(@Name("sniHostCheck")
boolean sniHostCheck)
public SecureRequestCustomizer(@Name("sniHostCheck")
boolean sniHostCheck,
@Name("stsMaxAgeSeconds")
long stsMaxAgeSeconds,
@Name("stsIncludeSubdomains")
boolean stsIncludeSubdomains)
sniHostCheck - True if the SNI Host name must match.stsMaxAgeSeconds - The max age in seconds for a Strict-Transport-Security response header. If set less than zero then no header is sent.stsIncludeSubdomains - If true, a include subdomain property is sent with any Strict-Transport-Security headerpublic boolean isSniHostCheck()
public void setSniHostCheck(boolean sniHostCheck)
sniHostCheck - True if the SNI Host name must match.public long getStsMaxAge()
public void setStsMaxAge(long stsMaxAgeSeconds)
stsMaxAgeSeconds - The max age in seconds for a Strict-Transport-Security response header. If set less than zero then no header is sent.public void setStsMaxAge(long period,
java.util.concurrent.TimeUnit units)
setStsMaxAge(long)period - The period in unitsunits - The TimeUnit of the periodpublic boolean isStsIncludeSubDomains()
public void setStsIncludeSubDomains(boolean stsIncludeSubDomains)
stsIncludeSubDomains - If true, a include subdomain property is sent with any Strict-Transport-Security headerpublic void customize(Connector connector, HttpConfiguration channelConfig, Request request)
customize in interface HttpConfiguration.Customizerprotected void customizeSecure(Request request)
Request.setSecure(boolean) with true
and sets a response header if the Strict-Transport-Security options
are set.request - the request being customizedprotected void customize(javax.net.ssl.SSLEngine sslEngine,
Request request)
Customizes the request attributes to be set for SSL requests.
The requirements of the Servlet specs are:
sslEngine - the sslEngine to be customized.request - HttpRequest to be customized.public void setSslSessionAttribute(java.lang.String attribute)
public java.lang.String getSslSessionAttribute()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2018 Webtide. All rights reserved.