Package org.apache.coyote.http11
Class AbstractHttp11Protocol<S>
java.lang.Object
org.apache.coyote.AbstractProtocol<S>
org.apache.coyote.http11.AbstractHttp11Protocol<S>
- All Implemented Interfaces:
MBeanRegistration,ProtocolHandler
- Direct Known Subclasses:
AbstractHttp11JsseProtocol,Http11AprProtocol
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.coyote.AbstractProtocol
AbstractProtocol.AsyncTimeout, AbstractProtocol.ConnectionHandler<S>, AbstractProtocol.RecycledProcessors -
Field Summary
FieldsFields inherited from class org.apache.coyote.AbstractProtocol
adapter, clientCertProvider, domain, mserver, oname, processorCache, rgOname -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedTrailerHeader(String header) 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.protected ProcessorCreate and configure a new Processor instance for the current protocol implementation.protected ProcessorcreateUpgradeProcessor(SocketWrapperBase<?> socket, UpgradeToken upgradeToken) voiddestroy()Destroy the protocol (optional).Find all configured SSL virtual host configurations which will be used by SNI.Return all configured upgrade protocols.booleanDeprecated.Deprecated.String[]Deprecated.String[]intintSpecifies a different (usually longer) connection timeout during data upload.booleanGet the flag that controls upload time-outs.protected AbstractEndpoint<S,?> intintintintintintReturn the maximum size of the post which will be saved during FORM or CLIENT-CERT authentication.intintgetNegotiatedProtocol(String negotiatedName) Find a suitable handler for the protocol negotiated at the network layer.booleanDeprecated.getONameForUpgrade(String upgradeProtocol) protected StringObtain the name of the protocol, (Http, Ajp, etc.).booleanDeprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.booleanDeprecated.Now an alias forgetRejectIllegalHeader().booleanbooleanShould application provider values for the HTTP Server header be removed.intintbooleanbooleanintintgetUpgradeGroupInfo(String upgradeProtocol) getUpgradeProtocol(String upgradedName) Find a suitable handler for the protocol upgraded name specified.booleanbooleanvoidinit()Initialise the protocol.booleanvoidreloadSslHostConfig(String hostName) voidvoidremoveAllowedTrailerHeader(String header) voidsetAlgorithm(String keyManagerAlgorithm) voidsetAllowedTrailerHeaders(String commaSeparatedHeaders) voidsetAllowHostHeaderMismatch(boolean allowHostHeaderMismatch) Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded tofalse.voidsetCiphers(String ciphers) voidsetClientAuth(String certificateVerification) voidsetCompressableMimeType(String valueS) Deprecated.voidsetCompressibleMimeType(String valueS) voidsetCompression(String compression) voidsetCompressionMinSize(int compressionMinSize) voidsetConnectionUploadTimeout(int timeout) Set the upload timeout.voidsetContinueResponseTiming(String continueResponseTiming) voidsetCrlFile(String certificateRevocationListFile) voidsetDefaultSSLHostConfigName(String defaultSSLHostConfigName) voidsetDisableUploadTimeout(boolean isDisabled) Set the flag to control whether a separate connection timeout is used during upload of a request body.voidsetKeyAlias(String certificateKeyAlias) voidsetKeyPass(String certificateKeyPassword) voidsetKeyPassFile(String certificateKeyPasswordFile) voidsetKeystoreFile(String keystoreFile) voidsetKeystorePass(String certificateKeystorePassword) voidsetKeystorePassFile(String certificateKeystorePasswordFile) voidsetKeystoreProvider(String certificateKeystoreProvider) voidsetKeystoreType(String certificateKeystoreType) voidsetMaxExtensionSize(int maxExtensionSize) voidsetMaxHttpHeaderSize(int valueI) voidsetMaxHttpRequestHeaderSize(int valueI) voidsetMaxHttpResponseHeaderSize(int valueI) 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) voidsetMaxTrailerSize(int maxTrailerSize) voidsetNoCompressionStrongETag(boolean noCompressionStrongETag) Deprecated.voidsetNoCompressionUserAgents(String noCompressionUserAgents) voidsetRejectIllegalHeader(boolean rejectIllegalHeader) Deprecated.This will removed in Tomcat 11 onwards whereallowHostHeaderMismatchwill be hard-coded totrue.voidsetRejectIllegalHeaderName(boolean rejectIllegalHeaderName) Deprecated.Now an alias forsetRejectIllegalHeader(boolean).voidsetRelaxedPathChars(String relaxedPathChars) voidsetRelaxedQueryChars(String relaxedQueryChars) voidsetRestrictedUserAgents(String valueS) voidsetSecure(boolean b) voidSet the server header name.voidsetServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues) voidsetSessionCacheSize(int sessionCacheSize) voidsetSessionTimeout(int sessionTimeout) voidsetSSLCACertificateFile(String caCertificateFile) voidsetSSLCACertificatePath(String caCertificatePath) voidsetSSLCARevocationFile(String certificateRevocationListFile) voidsetSSLCARevocationPath(String certificateRevocationListPath) voidsetSSLCertificateChainFile(String certificateChainFile) voidsetSSLCertificateFile(String certificateFile) voidsetSSLCertificateKeyFile(String certificateKeyFile) voidsetSSLCipherSuite(String ciphers) voidsetSSLDisableCompression(boolean disableCompression) voidsetSSLDisableSessionTickets(boolean disableSessionTickets) voidsetSSLEnabled(boolean SSLEnabled) voidsetSslEnabledProtocols(String enabledProtocols) voidsetSSLHonorCipherOrder(String honorCipherOrder) voidsetSSLPassword(String certificateKeyPassword) voidsetSSLPasswordFile(String certificateKeyPasswordFile) voidsetSslProtocol(String sslProtocol) voidsetSSLProtocol(String sslProtocol) voidsetSSLVerifyClient(String certificateVerification) voidsetSSLVerifyDepth(int certificateVerificationDepth) voidsetTrustManagerClassName(String trustManagerClassName) voidsetTrustMaxCertLength(int certificateVerificationDepth) voidsetTruststoreAlgorithm(String truststoreAlgorithm) voidsetTruststoreFile(String truststoreFile) voidsetTruststorePass(String truststorePassword) voidsetTruststoreProvider(String truststoreProvider) voidsetTruststoreType(String truststoreType) voidsetUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader) voidsetUseSendfile(boolean useSendfile) voidsetUseServerCipherSuitesOrder(String honorCipherOrder) booleanuseCompression(Request request, Response response) Methods inherited from class org.apache.coyote.AbstractProtocol
addWaitingProcessor, awaitConnectionsClose, closeServerSocketGraceful, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAdapter, getAddress, getAsyncTimeout, getBacklog, getClientCertProvider, getConnectionCount, getConnectionLinger, getConnectionTimeout, getDomain, getExecutor, getGlobalRequestProcessorMBeanName, getHandler, getKeepAliveTimeout, getLocalPort, getLog, getMaxConnections, getMaxHeaderCount, getMaxThreads, getMinSpareThreads, getName, getNameIndex, getNamePrefix, getObjectName, getPort, getPortOffset, getPortWithOffset, getProcessorCache, getProperty, getSendReasonPhrase, getSoLinger, getSoTimeout, getTcpNoDelay, getThreadPriority, getWaitingProcessorCount, isAprRequired, isSendfileSupported, pause, postDeregister, postRegister, preDeregister, preRegister, removeWaitingProcessor, resume, setAcceptCount, setAcceptorThreadCount, setAcceptorThreadPriority, setAdapter, setAddress, setBacklog, setClientCertProvider, setConnectionLinger, setConnectionTimeout, setExecutor, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxHeaderCount, setMaxThreads, setMinSpareThreads, setPort, setPortOffset, setProcessorCache, setProperty, setSendReasonPhrase, setSoLinger, setSoTimeout, setTcpNoDelay, setThreadPriority, start, stop
-
Field Details
-
sm
-
-
Constructor Details
-
AbstractHttp11Protocol
-
-
Method Details
-
init
Description copied from interface:ProtocolHandlerInitialise the protocol.- Specified by:
initin interfaceProtocolHandler- Overrides:
initin classAbstractProtocol<S>- Throws:
Exception- If the protocol handler fails to initialise
-
destroy
Description copied from interface:ProtocolHandlerDestroy the protocol (optional).- Specified by:
destroyin interfaceProtocolHandler- Overrides:
destroyin classAbstractProtocol<S>- Throws:
Exception- If the protocol handler fails to destroy
-
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
Over-ridden here to make the method visible to nested classes.
- Overrides:
getEndpointin classAbstractProtocol<S>
-
getContinueResponseTiming
-
setContinueResponseTiming
-
getContinueResponseTimingInternal
-
getUseKeepAliveResponseHeader
public boolean getUseKeepAliveResponseHeader() -
setUseKeepAliveResponseHeader
public void setUseKeepAliveResponseHeader(boolean useKeepAliveResponseHeader) -
getRelaxedPathChars
-
setRelaxedPathChars
-
getRelaxedQueryChars
-
setRelaxedQueryChars
-
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.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.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.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
-
getRejectIllegalHeaderName
Deprecated.Now an alias forgetRejectIllegalHeader(). Will be removed in Tomcat 10 onwards.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
-
setRejectIllegalHeaderName
Deprecated.Now an alias forsetRejectIllegalHeader(boolean). Will be removed in Tomcat 10 onwards.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:
rejectIllegalHeaderName-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() -
setMaxHttpHeaderSize
public void setMaxHttpHeaderSize(int valueI) -
getMaxHttpRequestHeaderSize
public int getMaxHttpRequestHeaderSize() -
setMaxHttpRequestHeaderSize
public void setMaxHttpRequestHeaderSize(int valueI) -
getMaxHttpResponseHeaderSize
public int getMaxHttpResponseHeaderSize() -
setMaxHttpResponseHeaderSize
public void setMaxHttpResponseHeaderSize(int valueI) -
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
-
getCompression
-
getNoCompressionUserAgents
-
setNoCompressionUserAgents
-
getCompressableMimeType
Deprecated.- Returns:
- See
getCompressibleMimeType()
-
setCompressableMimeType
Deprecated.- Parameters:
valueS- SeesetCompressibleMimeType(String)
-
getCompressableMimeTypes
Deprecated.- Returns:
- See
getCompressibleMimeTypes()
-
getCompressibleMimeType
-
setCompressibleMimeType
-
getCompressibleMimeTypes
-
getCompressionMinSize
public int getCompressionMinSize() -
setCompressionMinSize
public void setCompressionMinSize(int compressionMinSize) -
getNoCompressionStrongETag
Deprecated. -
setNoCompressionStrongETag
Deprecated. -
useCompression
-
getRestrictedUserAgents
-
setRestrictedUserAgents
-
getServer
-
setServer
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) -
getMaxTrailerSize
public int getMaxTrailerSize() -
setMaxTrailerSize
public void setMaxTrailerSize(int maxTrailerSize) -
getMaxExtensionSize
public int getMaxExtensionSize() -
setMaxExtensionSize
public void setMaxExtensionSize(int maxExtensionSize) -
getMaxSwallowSize
public int getMaxSwallowSize() -
setMaxSwallowSize
public void setMaxSwallowSize(int maxSwallowSize) -
getSecure
public boolean getSecure() -
setSecure
public void setSecure(boolean b) -
setAllowedTrailerHeaders
-
getAllowedTrailerHeadersInternal
-
getAllowedTrailerHeaders
-
addAllowedTrailerHeader
-
removeAllowedTrailerHeader
-
addUpgradeProtocol
Description copied from interface:ProtocolHandlerAdd a new protocol for used by HTTP/1.1 upgrade or ALPN.- Parameters:
upgradeProtocol- the protocol
-
findUpgradeProtocols
Description copied from interface:ProtocolHandlerReturn all configured upgrade protocols.- Returns:
- the protocols
-
getNegotiatedProtocol
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
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
-
getONameForUpgrade
-
isSSLEnabled
public boolean isSSLEnabled() -
setSSLEnabled
public void setSSLEnabled(boolean SSLEnabled) -
getUseSendfile
public boolean getUseSendfile() -
setUseSendfile
public void setUseSendfile(boolean useSendfile) -
getMaxKeepAliveRequests
public int getMaxKeepAliveRequests()- Returns:
- 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).
-
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
-
setDefaultSSLHostConfigName
-
addSslHostConfig
Description copied from interface:ProtocolHandlerAdd a new SSL configuration for a virtual host.- Parameters:
sslHostConfig- the configuration
-
addSslHostConfig
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
Description copied from interface:ProtocolHandlerFind all configured SSL virtual host configurations which will be used by SNI.- Returns:
- the configurations
-
reloadSslHostConfigs
public void reloadSslHostConfigs() -
reloadSslHostConfig
-
getSslEnabledProtocols
-
setSslEnabledProtocols
-
getSSLProtocol
-
setSSLProtocol
-
getKeystoreFile
-
setKeystoreFile
-
getSSLCertificateChainFile
-
setSSLCertificateChainFile
-
getSSLCertificateFile
-
setSSLCertificateFile
-
getSSLCertificateKeyFile
-
setSSLCertificateKeyFile
-
getAlgorithm
-
setAlgorithm
-
getClientAuth
-
setClientAuth
-
getSSLVerifyClient
-
setSSLVerifyClient
-
getTrustMaxCertLength
public int getTrustMaxCertLength() -
setTrustMaxCertLength
public void setTrustMaxCertLength(int certificateVerificationDepth) -
getSSLVerifyDepth
public int getSSLVerifyDepth() -
setSSLVerifyDepth
public void setSSLVerifyDepth(int certificateVerificationDepth) -
getUseServerCipherSuitesOrder
-
setUseServerCipherSuitesOrder
-
getSSLHonorCipherOrder
-
setSSLHonorCipherOrder
-
getCiphers
-
setCiphers
-
getSSLCipherSuite
-
setSSLCipherSuite
-
getKeystorePass
-
setKeystorePass
-
getKeystorePassFile
-
setKeystorePassFile
-
getKeyPass
-
setKeyPass
-
getKeyPassFile
-
setKeyPassFile
-
getSSLPassword
-
setSSLPassword
-
getSSLPasswordFile
-
setSSLPasswordFile
-
getCrlFile
-
setCrlFile
-
getSSLCARevocationFile
-
setSSLCARevocationFile
-
getSSLCARevocationPath
-
setSSLCARevocationPath
-
getKeystoreType
-
setKeystoreType
-
getKeystoreProvider
-
setKeystoreProvider
-
getKeyAlias
-
setKeyAlias
-
getTruststoreAlgorithm
-
setTruststoreAlgorithm
-
getTruststoreFile
-
setTruststoreFile
-
getTruststorePass
-
setTruststorePass
-
getTruststoreType
-
setTruststoreType
-
getTruststoreProvider
-
setTruststoreProvider
-
getSslProtocol
-
setSslProtocol
-
getSessionCacheSize
public int getSessionCacheSize() -
setSessionCacheSize
public void setSessionCacheSize(int sessionCacheSize) -
getSessionTimeout
public int getSessionTimeout() -
setSessionTimeout
public void setSessionTimeout(int sessionTimeout) -
getSSLCACertificatePath
-
setSSLCACertificatePath
-
getSSLCACertificateFile
-
setSSLCACertificateFile
-
getSSLDisableCompression
public boolean getSSLDisableCompression() -
setSSLDisableCompression
public void setSSLDisableCompression(boolean disableCompression) -
getSSLDisableSessionTickets
public boolean getSSLDisableSessionTickets() -
setSSLDisableSessionTickets
public void setSSLDisableSessionTickets(boolean disableSessionTickets) -
getTrustManagerClassName
-
setTrustManagerClassName
-
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
- Specified by:
createUpgradeProcessorin classAbstractProtocol<S>
-
allowHostHeaderMismatchwill be hard-coded tofalse.