Package org.apache.coyote.http11
Class AbstractHttp11Protocol<S>
- java.lang.Object
-
- org.apache.coyote.AbstractProtocol<S>
-
- org.apache.coyote.http11.AbstractHttp11Protocol<S>
-
- Type Parameters:
S- The socket type
- All Implemented Interfaces:
javax.management.MBeanRegistration,ProtocolHandler
- Direct Known Subclasses:
AbstractHttp11JsseProtocol
public abstract class AbstractHttp11Protocol<S> extends AbstractProtocol<S>
Base implementation of the HTTP/1.1 and HTTP/1.0 protocols.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.coyote.AbstractProtocol
AbstractProtocol.ConnectionHandler<S>, AbstractProtocol.RecycledProcessors
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersmThe StringManager for this package.-
Fields inherited from class org.apache.coyote.AbstractProtocol
adapter, domain, mserver, oname, processorCache, rgOname
-
-
Constructor Summary
Constructors Constructor Description AbstractHttp11Protocol(AbstractEndpoint<S,?> endpoint)Construct a specific instance of this protocol handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAllowedTrailerHeader(java.lang.String header)Add a header name to the set of allowed trailer headers.voidaddSslHostConfig(SSLHostConfig sslHostConfig)Add a new SSL configuration for a virtual host.voidaddSslHostConfig(SSLHostConfig sslHostConfig, boolean replace)Add a new SSL configuration for a virtual host.voidaddUpgradeProtocol(UpgradeProtocol upgradeProtocol)Add a new protocol for used by HTTP/1.1 upgrade or ALPN.booleancheckSni(java.lang.String sniHostName, java.lang.String protocolHostName)protected ProcessorcreateProcessor()Create and configure a new Processor instance for the current protocol implementation.protected ProcessorcreateUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken)Create and configure a new Processor instance for upgrade connections.voiddestroy()Destroys the protocol handler.SSLHostConfig[]findSslHostConfigs()Find all configured SSL virtual host configurations which will be used by SNI.UpgradeProtocol[]findUpgradeProtocols()Return all configured upgrade protocols.java.lang.StringgetAllowedTrailerHeaders()Get the list of allowed trailer headers as a comma-separated string.protected java.util.Set<java.lang.String>getAllowedTrailerHeadersInternal()Get the set of allowed trailer header names.booleangetAllowHostHeaderMismatch()Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded tofalse.java.lang.StringgetCompressibleMimeType()Get the MIME types that may be subject to compression.java.lang.String[]getCompressibleMimeTypes()Get the MIME types that may be subject to compression as an array.java.lang.StringgetCompression()Get the compression setting.protected intgetCompressionLevel()Get the compression level.intgetCompressionMinSize()Get the minimum response size for compression to be applied.intgetConnectionUploadTimeout()Specifies a different (usually longer) connection timeout during data upload.java.lang.StringgetContinueResponseTiming()Get the setting for how responses to 100-Continue requests will be sent.ContinueResponseTiminggetContinueResponseTimingInternal()Get the continue response timing setting as an enum value.java.lang.StringgetDefaultSSLHostConfigName()Get the default SSL host configuration name.booleangetDisableUploadTimeout()Get the flag that controls upload time-outs.protected AbstractEndpoint<S,?>getEndpoint()Gets the endpoint.HttpParsergetHttpParser()Get the HttpParser used to parse relaxed characters.intgetMaxExtensionSize()Get the maximum size of extension information in chunked encoding.intgetMaxHttpHeaderSize()Get the maximum size of the HTTP message header.intgetMaxHttpRequestHeaderSize()Get the maximum size of the HTTP request message header.intgetMaxHttpResponseHeaderSize()Get the maximum size of the HTTP response message header.intgetMaxKeepAliveRequests()Get the maximum number of requests which can be performed over a keep-alive connection.intgetMaxSavePostSize()Return the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.intgetMaxSwallowSize()Get the maximum amount of request body to swallow.intgetMaxTrailerSize()Get the maximum size of trailing headers.UpgradeProtocolgetNegotiatedProtocol(java.lang.String negotiatedName)Find a suitable handler for the protocol negotiated at the network layer.java.lang.StringgetNoCompressionEncodings()Get the content encodings that should not be used.java.lang.StringgetNoCompressionUserAgents()Get the list of user agents that should not use compression.protected java.util.regex.PatterngetNoCompressionUserAgentsPattern()Get the pattern of user agents that should not use compression.javax.management.ObjectNamegetONameForUpgrade(java.lang.String upgradeProtocol)Get the ObjectName for the MBean of the specified upgrade protocol.protected java.lang.StringgetProtocolName()Obtain the name of the protocol, (Http, Ajp, etc.).booleangetRejectIllegalHeader()Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.java.lang.StringgetRelaxedPathChars()Get the set of characters allowed in a URL path.java.lang.StringgetRelaxedQueryChars()Get the set of characters allowed in a URL query string.java.lang.StringgetRestrictedUserAgents()Get the string form of the regular expression that defines the User agents which should be restricted to HTTP/1.0 support.protected java.util.regex.PatterngetRestrictedUserAgentsPattern()Get the pattern of user agents that should be restricted to HTTP/1.0.booleangetSecure()Get the flag indicating if this protocol is treated as secure.java.lang.StringgetServer()Get the value of the Server response header.booleangetServerRemoveAppProvidedValues()Should application provider values for the HTTP Server header be removed.UpgradeGroupInfogetUpgradeGroupInfo(java.lang.String upgradeProtocol)Get the upgrade group info for the specified upgrade protocol.UpgradeProtocolgetUpgradeProtocol(java.lang.String upgradedName)Find a suitable handler for the protocol upgraded name specified.booleangetUseKeepAliveResponseHeader()Get the flag that controls whether the Keep-Alive response header will be used.booleangetUseSendfile()Check if sendfile is enabled for this connector.voidinit()Initializes the protocol handler.booleanisSSLEnabled()Check if SSL is enabled on this connector.booleanisTrailerHeaderAllowed(java.lang.String headerName)Check if a header name is in the set of allowed trailer headers.voidreloadSslHostConfig(java.lang.String hostName)Reload the SSL host configuration for the specified host.voidreloadSslHostConfigs()Reload all SSL host configurations.voidremoveAllowedTrailerHeader(java.lang.String header)Remove a header name from the set of allowed trailer headers.voidsetAllowedTrailerHeaders(java.lang.String commaSeparatedHeaders)Set the names of headers that are allowed to be sent via a trailer when using chunked encoding.voidsetAllowHostHeaderMismatch(boolean allowHostHeaderMismatch)Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded tofalse.voidsetCompressibleMimeType(java.lang.String valueS)Set the MIME types that may be subject to compression.voidsetCompression(java.lang.String compression)Set the compression setting.voidsetCompressionMinSize(int compressionMinSize)Set the minimum response size for compression to be applied.voidsetConnectionUploadTimeout(int timeout)Set the upload timeout.voidsetContinueResponseTiming(java.lang.String continueResponseTiming)Set the setting for how responses to 100-Continue requests will be sent.voidsetDefaultSSLHostConfigName(java.lang.String defaultSSLHostConfigName)Set the default SSL host configuration name.voidsetDisableUploadTimeout(boolean isDisabled)Set the flag to control whether a separate connection timeout is used during upload of a request body.voidsetMaxExtensionSize(int maxExtensionSize)Set the maximum size of extension information in chunked encoding.voidsetMaxHttpHeaderSize(int valueI)Set the maximum size of the HTTP message header.voidsetMaxHttpRequestHeaderSize(int valueI)Set the maximum size of the HTTP request message header.voidsetMaxHttpResponseHeaderSize(int valueI)Set the maximum size of the HTTP response message header.voidsetMaxKeepAliveRequests(int mkar)Set the maximum number of Keep-Alive requests to allow.voidsetMaxSavePostSize(int maxSavePostSize)Set the maximum size of a POST which will be buffered during FORM or CLIENT-CERT authentication.voidsetMaxSwallowSize(int maxSwallowSize)Set the maximum amount of request body to swallow.voidsetMaxTrailerSize(int maxTrailerSize)Set the maximum size of trailing headers.voidsetNoCompressionEncodings(java.lang.String encodings)Set the content encodings that should not be used.voidsetNoCompressionUserAgents(java.lang.String noCompressionUserAgents)Set the list of user agents that should not use compression.voidsetRejectIllegalHeader(boolean rejectIllegalHeader)Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.voidsetRelaxedPathChars(java.lang.String relaxedPathChars)Set the set of characters allowed in a URL path.voidsetRelaxedQueryChars(java.lang.String relaxedQueryChars)Set the set of characters allowed in a URL query string.voidsetRestrictedUserAgents(java.lang.String restrictedUserAgents)Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode).voidsetSecure(boolean b)Set the flag indicating if this protocol is treated as secure.voidsetServer(java.lang.String server)Set the server header name.voidsetServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)Set whether application provider values for the HTTP Server header should be removed.voidsetSSLEnabled(boolean SSLEnabled)Set whether SSL is enabled on this connector.voidsetUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader)Set the flag that controls whether the Keep-Alive response header will be used.voidsetUseSendfile(boolean useSendfile)Set whether sendfile is enabled for this connector.booleanuseCompression(Request request, Response response)Check if compression should be used for the specified request/response.-
Methods inherited from class org.apache.coyote.AbstractProtocol
addWaitingProcessor, awaitConnectionsClose, closeServerSocketGraceful, getAcceptCount, getAcceptorThreadPriority, getAdapter, getAddress, getClientCertProvider, getConnectionCount, getConnectionLinger, getConnectionTimeout, getDomain, getExecutor, getGlobalRequestProcessorMBeanName, getHandler, getId, getKeepAliveTimeout, getLocalPort, getLog, getMaxConnections, getMaxHeaderCount, getMaxQueueSize, getMaxThreads, getMinSpareThreads, getName, getNameIndex, getNamePrefix, getObjectName, getPort, getPortOffset, getPortWithOffset, getProcessorCache, getProperty, getTcpNoDelay, getThreadPriority, getUtilityExecutor, getWaitingProcessorCount, isPaused, isSendfileSupported, pause, postDeregister, postRegister, preDeregister, preRegister, removeWaitingProcessor, resume, setAcceptCount, setAcceptorThreadPriority, setAdapter, setAddress, setClientCertProvider, setConnectionLinger, setConnectionTimeout, setExecutor, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxHeaderCount, setMaxQueueSize, setMaxThreads, setMinSpareThreads, setPort, setPortOffset, setProcessorCache, setProperty, setTcpNoDelay, setThreadPriority, setUtilityExecutor, start, startAsyncTimeout, stop, stopAsyncTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.coyote.ProtocolHandler
getDesiredBufferSize
-
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The StringManager for this package.
-
-
Constructor Detail
-
AbstractHttp11Protocol
public AbstractHttp11Protocol(AbstractEndpoint<S,?> endpoint)
Construct a specific instance of this protocol handler.- Parameters:
endpoint- Endpoint on which to accept connections
-
-
Method Detail
-
init
public void init() throws java.lang.ExceptionDescription copied from class:AbstractProtocolInitializes the protocol handler.- Specified by:
initin interfaceProtocolHandler- Overrides:
initin classAbstractProtocol<S>- Throws:
java.lang.Exception- if initialization fails
-
destroy
public void destroy() throws java.lang.ExceptionDescription copied from class:AbstractProtocolDestroys the protocol handler.- Specified by:
destroyin interfaceProtocolHandler- Overrides:
destroyin classAbstractProtocol<S>- Throws:
java.lang.Exception- if destroy fails
-
getProtocolName
protected java.lang.String getProtocolName()
Description copied from class:AbstractProtocolObtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.- Specified by:
getProtocolNamein classAbstractProtocol<S>- Returns:
- the protocol name
-
getEndpoint
protected AbstractEndpoint<S,?> getEndpoint()
Gets the endpoint.Over-ridden here to make the method visible to nested classes.
- Overrides:
getEndpointin classAbstractProtocol<S>- Returns:
- the endpoint
-
getHttpParser
public HttpParser getHttpParser()
Get the HttpParser used to parse relaxed characters.- Returns:
- the HttpParser
-
getContinueResponseTiming
public java.lang.String getContinueResponseTiming()
Get the setting for how responses to 100-Continue requests will be sent.- Returns:
- The current continue response timing setting
-
setContinueResponseTiming
public void setContinueResponseTiming(java.lang.String continueResponseTiming)
Set the setting for how responses to 100-Continue requests will be sent.- Parameters:
continueResponseTiming- The new continue response timing setting
-
getContinueResponseTimingInternal
public ContinueResponseTiming getContinueResponseTimingInternal()
Get the continue response timing setting as an enum value.- Returns:
- The continue response timing
-
getUseKeepAliveResponseHeader
public boolean getUseKeepAliveResponseHeader()
Get the flag that controls whether the Keep-Alive response header will be used.- Returns:
trueif the Keep-Alive response header will be used
-
setUseKeepAliveResponseHeader
public void setUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader)
Set the flag that controls whether the Keep-Alive response header will be used.- Parameters:
useKeepAliveResponseHeader-trueif the Keep-Alive response header should be used
-
getRelaxedPathChars
public java.lang.String getRelaxedPathChars()
Get the set of characters allowed in a URL path.- Returns:
- The allowed path characters
-
setRelaxedPathChars
public void setRelaxedPathChars(java.lang.String relaxedPathChars)
Set the set of characters allowed in a URL path.- Parameters:
relaxedPathChars- The allowed path characters
-
getRelaxedQueryChars
public java.lang.String getRelaxedQueryChars()
Get the set of characters allowed in a URL query string.- Returns:
- The allowed query characters
-
setRelaxedQueryChars
public void setRelaxedQueryChars(java.lang.String relaxedQueryChars)
Set the set of characters allowed in a URL query string.- Parameters:
relaxedQueryChars- The allowed query characters
-
getAllowHostHeaderMismatch
@Deprecated public boolean getAllowHostHeaderMismatch()
Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded tofalse.Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?- Returns:
trueif Tomcat will allow such requests, otherwisefalse
-
setAllowHostHeaderMismatch
@Deprecated public void setAllowHostHeaderMismatch(boolean allowHostHeaderMismatch)
Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded tofalse.Will Tomcat accept an HTTP 1.1 request where the host header does not agree with the host specified (if any) in the request line?- Parameters:
allowHostHeaderMismatch-trueto allow such requests,falseto reject them with a 400
-
getRejectIllegalHeader
@Deprecated public boolean getRejectIllegalHeader()
Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) will the request be rejected (with a 400 response) or will the illegal header be ignored?- Returns:
trueif the request will be rejected orfalseif the header will be ignored
-
setRejectIllegalHeader
@Deprecated public void setRejectIllegalHeader(boolean rejectIllegalHeader)
Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.If an HTTP request is received that contains an illegal header name or value (e.g. the header name is not a token) should the request be rejected (with a 400 response) or should the illegal header be ignored?- Parameters:
rejectIllegalHeader-trueto reject requests with illegal header names or values,falseto ignore the header
-
getMaxSavePostSize
public int getMaxSavePostSize()
Return the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.- Returns:
- The size in bytes
-
setMaxSavePostSize
public void setMaxSavePostSize(int maxSavePostSize)
Set the maximum size of a POST which will be buffered during FORM or CLIENT-CERT authentication. When a POST is received where the security constraints require a client certificate, the POST body needs to be buffered while an SSL handshake takes place to obtain the certificate. A similar buffering is required during FORM auth.- Parameters:
maxSavePostSize- The maximum size POST body to buffer in bytes
-
getMaxHttpHeaderSize
public int getMaxHttpHeaderSize()
Get the maximum size of the HTTP message header.- Returns:
- The maximum size of the HTTP message header in bytes
-
setMaxHttpHeaderSize
public void setMaxHttpHeaderSize(int valueI)
Set the maximum size of the HTTP message header.- Parameters:
valueI- The maximum size of the HTTP message header in bytes
-
getMaxHttpRequestHeaderSize
public int getMaxHttpRequestHeaderSize()
Get the maximum size of the HTTP request message header.- Returns:
- The maximum size of the HTTP request message header in bytes
-
setMaxHttpRequestHeaderSize
public void setMaxHttpRequestHeaderSize(int valueI)
Set the maximum size of the HTTP request message header.- Parameters:
valueI- The maximum size of the HTTP request message header in bytes
-
getMaxHttpResponseHeaderSize
public int getMaxHttpResponseHeaderSize()
Get the maximum size of the HTTP response message header.- Returns:
- The maximum size of the HTTP response message header in bytes
-
setMaxHttpResponseHeaderSize
public void setMaxHttpResponseHeaderSize(int valueI)
Set the maximum size of the HTTP response message header.- Parameters:
valueI- The maximum size of the HTTP response message header in bytes
-
getConnectionUploadTimeout
public int getConnectionUploadTimeout()
Specifies a different (usually longer) connection timeout during data upload. Default is 5 minutes as in Apache HTTPD server.- Returns:
- The timeout in milliseconds
-
setConnectionUploadTimeout
public void setConnectionUploadTimeout(int timeout)
Set the upload timeout.- Parameters:
timeout- Upload timeout in milliseconds
-
getDisableUploadTimeout
public boolean getDisableUploadTimeout()
Get the flag that controls upload time-outs. If true, the connectionUploadTimeout will be ignored and the regular socket timeout will be used for the full duration of the connection.- Returns:
trueif the separate upload timeout is disabled
-
setDisableUploadTimeout
public void setDisableUploadTimeout(boolean isDisabled)
Set the flag to control whether a separate connection timeout is used during upload of a request body.- Parameters:
isDisabled-trueif the separate upload timeout should be disabled
-
setCompression
public void setCompression(java.lang.String compression)
Set the compression setting.- Parameters:
compression- The compression setting
-
getCompression
public java.lang.String getCompression()
Get the compression setting.- Returns:
- The compression setting
-
getCompressionLevel
protected int getCompressionLevel()
Get the compression level.- Returns:
- The compression level
-
getNoCompressionUserAgents
public java.lang.String getNoCompressionUserAgents()
Get the list of user agents that should not use compression.- Returns:
- The user agents that should not use compression
-
getNoCompressionUserAgentsPattern
protected java.util.regex.Pattern getNoCompressionUserAgentsPattern()
Get the pattern of user agents that should not use compression.- Returns:
- The pattern of user agents that should not use compression
-
setNoCompressionUserAgents
public void setNoCompressionUserAgents(java.lang.String noCompressionUserAgents)
Set the list of user agents that should not use compression.- Parameters:
noCompressionUserAgents- The user agents that should not use compression
-
getCompressibleMimeType
public java.lang.String getCompressibleMimeType()
Get the MIME types that may be subject to compression.- Returns:
- The MIME types that may be subject to compression
-
setCompressibleMimeType
public void setCompressibleMimeType(java.lang.String valueS)
Set the MIME types that may be subject to compression.- Parameters:
valueS- The MIME types that may be subject to compression
-
getCompressibleMimeTypes
public java.lang.String[] getCompressibleMimeTypes()
Get the MIME types that may be subject to compression as an array.- Returns:
- The MIME types that may be subject to compression
-
getCompressionMinSize
public int getCompressionMinSize()
Get the minimum response size for compression to be applied.- Returns:
- The minimum response size in bytes
-
setCompressionMinSize
public void setCompressionMinSize(int compressionMinSize)
Set the minimum response size for compression to be applied.- Parameters:
compressionMinSize- The minimum response size in bytes
-
getNoCompressionEncodings
public java.lang.String getNoCompressionEncodings()
Get the content encodings that should not be used.- Returns:
- The content encodings that should not be used
-
setNoCompressionEncodings
public void setNoCompressionEncodings(java.lang.String encodings)
Set the content encodings that should not be used.- Parameters:
encodings- The content encodings that should not be used
-
useCompression
public boolean useCompression(Request request, Response response)
Check if compression should be used for the specified request/response.- Parameters:
request- The HTTP requestresponse- The HTTP response- Returns:
trueif compression should be used
-
getRestrictedUserAgents
public java.lang.String getRestrictedUserAgents()
Get the string form of the regular expression that defines the User agents which should be restricted to HTTP/1.0 support.- Returns:
- The regular expression as a String
-
getRestrictedUserAgentsPattern
protected java.util.regex.Pattern getRestrictedUserAgentsPattern()
Get the pattern of user agents that should be restricted to HTTP/1.0.- Returns:
- The pattern of user agents that should be restricted to HTTP/1.0
-
setRestrictedUserAgents
public void setRestrictedUserAgents(java.lang.String restrictedUserAgents)
Set restricted user agent list (which will downgrade the connector to HTTP/1.0 mode). Regular expression as supported byPattern.- Parameters:
restrictedUserAgents- The regular expression as supported byPatternfor the user agents e.g. "gorilla|desesplorer|tigrus"
-
getServer
public java.lang.String getServer()
Get the value of the Server response header.- Returns:
- The value of the Server response header
-
setServer
public void setServer(java.lang.String server)
Set the server header name.- Parameters:
server- The new value to use for the server header
-
getServerRemoveAppProvidedValues
public boolean getServerRemoveAppProvidedValues()
Should application provider values for the HTTP Server header be removed. Note that ifserveris set, any application provided value will be over-ridden.- Returns:
trueif application provided values should be removed, otherwisefalse
-
setServerRemoveAppProvidedValues
public void setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues)
Set whether application provider values for the HTTP Server header should be removed.- Parameters:
serverRemoveAppProvidedValues-trueif application provided values should be removed
-
getMaxTrailerSize
public int getMaxTrailerSize()
Get the maximum size of trailing headers.- Returns:
- The maximum size of trailing headers in bytes
-
setMaxTrailerSize
public void setMaxTrailerSize(int maxTrailerSize)
Set the maximum size of trailing headers.- Parameters:
maxTrailerSize- The maximum size of trailing headers in bytes
-
getMaxExtensionSize
public int getMaxExtensionSize()
Get the maximum size of extension information in chunked encoding.- Returns:
- The maximum size of extension information in bytes
-
setMaxExtensionSize
public void setMaxExtensionSize(int maxExtensionSize)
Set the maximum size of extension information in chunked encoding.- Parameters:
maxExtensionSize- The maximum size of extension information in bytes
-
getMaxSwallowSize
public int getMaxSwallowSize()
Get the maximum amount of request body to swallow.- Returns:
- The maximum amount of request body to swallow in bytes
-
setMaxSwallowSize
public void setMaxSwallowSize(int maxSwallowSize)
Set the maximum amount of request body to swallow.- Parameters:
maxSwallowSize- The maximum amount of request body to swallow in bytes
-
getSecure
public boolean getSecure()
Get the flag indicating if this protocol is treated as secure.- Returns:
trueif this protocol is treated as secure
-
setSecure
public void setSecure(boolean b)
Set the flag indicating if this protocol is treated as secure.- Parameters:
b-trueif this protocol is treated as secure
-
setAllowedTrailerHeaders
public void setAllowedTrailerHeaders(java.lang.String commaSeparatedHeaders)
Set the names of headers that are allowed to be sent via a trailer when using chunked encoding.- Parameters:
commaSeparatedHeaders- Comma separated list of header names
-
getAllowedTrailerHeadersInternal
protected java.util.Set<java.lang.String> getAllowedTrailerHeadersInternal()
Get the set of allowed trailer header names.- Returns:
- The set of allowed trailer header names
-
isTrailerHeaderAllowed
public boolean isTrailerHeaderAllowed(java.lang.String headerName)
Check if a header name is in the set of allowed trailer headers.- Parameters:
headerName- The header name to check- Returns:
trueif the header is allowed as a trailer header
-
getAllowedTrailerHeaders
public java.lang.String getAllowedTrailerHeaders()
Get the list of allowed trailer headers as a comma-separated string.- Returns:
- The allowed trailer headers as a comma-separated string
-
addAllowedTrailerHeader
public void addAllowedTrailerHeader(java.lang.String header)
Add a header name to the set of allowed trailer headers.- Parameters:
header- The header name to add
-
removeAllowedTrailerHeader
public void removeAllowedTrailerHeader(java.lang.String header)
Remove a header name from the set of allowed trailer headers.- Parameters:
header- The header name to remove
-
addUpgradeProtocol
public void addUpgradeProtocol(UpgradeProtocol upgradeProtocol)
Description copied from interface:ProtocolHandlerAdd a new protocol for used by HTTP/1.1 upgrade or ALPN.- Parameters:
upgradeProtocol- the protocol
-
findUpgradeProtocols
public UpgradeProtocol[] findUpgradeProtocols()
Description copied from interface:ProtocolHandlerReturn all configured upgrade protocols.- Returns:
- the protocols
-
getNegotiatedProtocol
public UpgradeProtocol getNegotiatedProtocol(java.lang.String negotiatedName)
Description copied from class:AbstractProtocolFind a suitable handler for the protocol negotiated at the network layer.- Specified by:
getNegotiatedProtocolin classAbstractProtocol<S>- Parameters:
negotiatedName- The name of the requested negotiated protocol.- Returns:
- The instance where
UpgradeProtocol.getAlpnName()matches the requested protocol
-
getUpgradeProtocol
public UpgradeProtocol getUpgradeProtocol(java.lang.String upgradedName)
Description copied from class:AbstractProtocolFind a suitable handler for the protocol upgraded name specified. This is used for direct connection protocol selection.- Specified by:
getUpgradeProtocolin classAbstractProtocol<S>- Parameters:
upgradedName- The name of the requested negotiated protocol.- Returns:
- The instance where
UpgradeProtocol.getAlpnName()matches the requested protocol
-
getUpgradeGroupInfo
public UpgradeGroupInfo getUpgradeGroupInfo(java.lang.String upgradeProtocol)
Get the upgrade group info for the specified upgrade protocol.- Parameters:
upgradeProtocol- The upgrade protocol name- Returns:
- The upgrade group info for the specified protocol
-
getONameForUpgrade
public javax.management.ObjectName getONameForUpgrade(java.lang.String upgradeProtocol)
Get the ObjectName for the MBean of the specified upgrade protocol.- Parameters:
upgradeProtocol- The upgrade protocol name- Returns:
- The ObjectName for the upgrade protocol MBean, or
null
-
isSSLEnabled
public boolean isSSLEnabled()
Check if SSL is enabled on this connector.- Returns:
trueif SSL is enabled
-
setSSLEnabled
public void setSSLEnabled(boolean SSLEnabled)
Set whether SSL is enabled on this connector.- Parameters:
SSLEnabled-trueif SSL is enabled
-
getUseSendfile
public boolean getUseSendfile()
Check if sendfile is enabled for this connector.- Returns:
trueif sendfile is enabled
-
setUseSendfile
public void setUseSendfile(boolean useSendfile)
Set whether sendfile is enabled for this connector.- Parameters:
useSendfile-trueif sendfile is enabled
-
getMaxKeepAliveRequests
public int getMaxKeepAliveRequests()
Get the maximum number of requests which can be performed over a keep-alive connection. The default is the same as for Apache HTTP Server (100).- Returns:
- The maximum number of requests which can be performed over a keep-alive connection
-
setMaxKeepAliveRequests
public void setMaxKeepAliveRequests(int mkar)
Set the maximum number of Keep-Alive requests to allow. This is to safeguard from DoS attacks. Setting to a negative value disables the limit.- Parameters:
mkar- The new maximum number of Keep-Alive requests allowed
-
getDefaultSSLHostConfigName
public java.lang.String getDefaultSSLHostConfigName()
Get the default SSL host configuration name.- Returns:
- The default SSL host configuration name
-
setDefaultSSLHostConfigName
public void setDefaultSSLHostConfigName(java.lang.String defaultSSLHostConfigName)
Set the default SSL host configuration name.- Parameters:
defaultSSLHostConfigName- The default SSL host configuration name
-
addSslHostConfig
public void addSslHostConfig(SSLHostConfig sslHostConfig)
Description copied from interface:ProtocolHandlerAdd a new SSL configuration for a virtual host.- Parameters:
sslHostConfig- the configuration
-
addSslHostConfig
public void addSslHostConfig(SSLHostConfig sslHostConfig, boolean replace)
Description copied from interface:ProtocolHandlerAdd a new SSL configuration for a virtual host.- Parameters:
sslHostConfig- the configurationreplace- Iftruereplacement of an existing configuration is permitted, otherwise any such attempted replacement will trigger an exception
-
findSslHostConfigs
public SSLHostConfig[] findSslHostConfigs()
Description copied from interface:ProtocolHandlerFind all configured SSL virtual host configurations which will be used by SNI.- Returns:
- the configurations
-
reloadSslHostConfigs
public void reloadSslHostConfigs()
Reload all SSL host configurations.
-
reloadSslHostConfig
public void reloadSslHostConfig(java.lang.String hostName)
Reload the SSL host configuration for the specified host.- Parameters:
hostName- The host name to reload
-
checkSni
public boolean checkSni(java.lang.String sniHostName, java.lang.String protocolHostName)
-
createProcessor
protected Processor createProcessor()
Description copied from class:AbstractProtocolCreate and configure a new Processor instance for the current protocol implementation.- Specified by:
createProcessorin classAbstractProtocol<S>- Returns:
- A fully configured Processor instance that is ready to use
-
createUpgradeProcessor
protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken)
Description copied from class:AbstractProtocolCreate and configure a new Processor instance for upgrade connections.- Specified by:
createUpgradeProcessorin classAbstractProtocol<S>- Parameters:
socket- The socket for the upgrade connectionupgradeToken- The upgrade token containing upgrade information- Returns:
- A fully configured Processor instance that is ready to use
-
-