public class SecureRequestCustomizer extends 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 and Description |
---|---|
static String |
CACHED_INFO_ATTR
The name of the SSLSession attribute that will contain any cached information.
|
Constructor and Description |
---|
SecureRequestCustomizer() |
SecureRequestCustomizer(boolean sniHostCheck) |
SecureRequestCustomizer(boolean sniRequired,
boolean sniHostCheck,
long stsMaxAgeSeconds,
boolean stsIncludeSubdomains) |
SecureRequestCustomizer(boolean sniHostCheck,
long stsMaxAgeSeconds,
boolean stsIncludeSubdomains) |
Modifier and Type | Method and Description |
---|---|
void |
customize(Connector connector,
HttpConfiguration channelConfig,
Request request) |
String |
getSslSessionAttribute() |
long |
getStsMaxAge() |
boolean |
isSniHostCheck() |
boolean |
isSniRequired() |
boolean |
isStsIncludeSubDomains() |
void |
setSniHostCheck(boolean sniHostCheck) |
void |
setSniRequired(boolean sniRequired) |
void |
setSslSessionAttribute(String attribute) |
void |
setStsIncludeSubDomains(boolean stsIncludeSubDomains) |
void |
setStsMaxAge(long stsMaxAgeSeconds)
Set the Strict-Transport-Security max age.
|
void |
setStsMaxAge(long period,
TimeUnit units)
Convenience method to call
setStsMaxAge(long) |
String |
toString() |
public static final String CACHED_INFO_ATTR
public SecureRequestCustomizer()
public SecureRequestCustomizer(@Name(value="sniHostCheck") boolean sniHostCheck)
public SecureRequestCustomizer(@Name(value="sniHostCheck") boolean sniHostCheck, @Name(value="stsMaxAgeSeconds") long stsMaxAgeSeconds, @Name(value="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 SecureRequestCustomizer(@Name(value="sniRequired") boolean sniRequired, @Name(value="sniHostCheck") boolean sniHostCheck, @Name(value="stsMaxAgeSeconds") long stsMaxAgeSeconds, @Name(value="stsIncludeSubdomains") boolean stsIncludeSubdomains)
sniRequired
- True if a SNI certificate is required.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 when there is an SNI certificate.public boolean isSniRequired()
SslContextFactory.Server#isSniRequired()
public void setSniRequired(boolean sniRequired)
sniRequired
- True if SNI is required, else requests will be rejected with 400 response.SslContextFactory.Server#setSniRequired(boolean)
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, 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.Customizer
public void setSslSessionAttribute(String attribute)
public String getSslSessionAttribute()
Copyright © 2010 - 2020 Adobe. All Rights Reserved