Package org.eclipse.jetty.server
Class SecureRequestCustomizer
java.lang.Object
org.eclipse.jetty.server.SecureRequestCustomizer
- All Implemented Interfaces:
HttpConfiguration.Customizer
Customizer that extracts the attribute of an SSLContext
and makes them available via Attributes.getAttribute(String)
using the names:
EndPoint.SslSessionData.ATTRIBUTE
forEndPoint.SslSessionData
X509_ATTRIBUTE
for the local certificate as aX509
instance
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSecureRequestCustomizer
(boolean sniHostCheck) SecureRequestCustomizer
(boolean sniRequired, boolean sniHostCheck, long stsMaxAgeSeconds, boolean stsIncludeSubdomains) SecureRequestCustomizer
(boolean sniHostCheck, long stsMaxAgeSeconds, boolean stsIncludeSubdomains) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkSni
(Request request, SSLSession session) customize
(Request request, HttpFields.Mutable responseHeaders) long
boolean
boolean
boolean
protected Request
newSecureRequest
(Request request, EndPoint.SslSessionData sslSessionData) void
setSniHostCheck
(boolean sniHostCheck) void
setSniRequired
(boolean sniRequired) void
setStsIncludeSubDomains
(boolean stsIncludeSubDomains) Set whether theincludeSubdomains
attribute is sent with the Strict-Transport-Security response header.void
setStsMaxAge
(long stsMaxAgeSeconds) Sets the Strict-Transport-Security max age in seconds.void
setStsMaxAge
(long period, TimeUnit units) Sets the Strict-Transport-Security max age in the given time unit.toString()
-
Field Details
-
X509_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
SecureRequestCustomizer
public SecureRequestCustomizer() -
SecureRequestCustomizer
-
SecureRequestCustomizer
public SecureRequestCustomizer(@Name("sniHostCheck") boolean sniHostCheck, @Name("stsMaxAgeSeconds") long stsMaxAgeSeconds, @Name("stsIncludeSubdomains") boolean stsIncludeSubdomains) - Parameters:
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, an include subdomain property is sent with any Strict-Transport-Security header
-
SecureRequestCustomizer
public SecureRequestCustomizer(@Name("sniRequired") boolean sniRequired, @Name("sniHostCheck") boolean sniHostCheck, @Name("stsMaxAgeSeconds") long stsMaxAgeSeconds, @Name("stsIncludeSubdomains") boolean stsIncludeSubdomains) - Parameters:
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, an include subdomain property is sent with any Strict-Transport-Security header
-
-
Method Details
-
isSniHostCheck
public boolean isSniHostCheck()- Returns:
- True if the SNI Host name must match when there is an SNI certificate.
-
setSniHostCheck
public void setSniHostCheck(boolean sniHostCheck) - Parameters:
sniHostCheck
- True if the SNI Host name must match when there is an SNI certificate.
-
isSniRequired
public boolean isSniRequired()- Returns:
- True if SNI is required, else requests will be rejected with 400 response.
- See Also:
-
setSniRequired
public void setSniRequired(boolean sniRequired) - Parameters:
sniRequired
- True if SNI is required, else requests will be rejected with 400 response.- See Also:
-
getStsMaxAge
public long getStsMaxAge()- Returns:
- The max age in seconds for a Strict-Transport-Security response header. If set less than zero then no header is sent.
-
setStsMaxAge
public void setStsMaxAge(long stsMaxAgeSeconds) Sets the Strict-Transport-Security max age in seconds.- Parameters:
stsMaxAgeSeconds
- the max age in seconds for the Strict-Transport-Security response header. If less than zero then no Strict-Transport-Security response header is set.
-
setStsMaxAge
Sets the Strict-Transport-Security max age in the given time unit.- Parameters:
period
- The max age valueunits
- TheTimeUnit
of the max age
-
isStsIncludeSubDomains
public boolean isStsIncludeSubDomains()- Returns:
- whether the
includeSubdomains
attribute is sent with the Strict-Transport-Security response header
-
setStsIncludeSubDomains
public void setStsIncludeSubDomains(boolean stsIncludeSubDomains) Set whether theincludeSubdomains
attribute is sent with the Strict-Transport-Security response header.- Parameters:
stsIncludeSubDomains
- whether theincludeSubdomains
attribute is sent with the Strict-Transport-Security response header
-
customize
- Specified by:
customize
in interfaceHttpConfiguration.Customizer
-
newSecureRequest
-
checkSni
-
toString
-