tomcat-配置HTTP/2.0协议
HTTP/2.0协议
Tomcat中默认使用HTTP/1.1协议,如果想将通信协议升级为HTTP/2.0不是简单的将Connector的protocol属性从“HTTP/1.1”替换为“HTTP/2.0”即可,具体配置如下:
<Connector port="8080"protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" >
<UpgradeProtocolclassName=”org.apache.coyote.http2.Http2Protocol” />
<Connector/>
如何设置SSL安全协议呢?HTTP/2.0支持TLS和非TLS两种安全协议。
<Connector port="8443"protocol="HTTP/1.1"
maxTHreads=”150” SSLEnabled=”true”
sslImplementationName=”org.apache.tomcat.util.net.openssl.OPenSSLImplementation”>
<UpgradeProtocolclassName=”org.apache.coyote.http2.Http2Protocol” />
<SSLHostConfig>
<Cretificate certificateKeyFile=”conf/key.pem”
certificateFile=”conf/cerf.pem”
certificateChainFile=”conf/chain.pem”type=”RSA”
/>
</ SSLHostConfig>
<Connector/>
Tomcat中默认使用HTTP/1.1协议,如果想将通信协议升级为HTTP/2.0不是简单的将Connector的protocol属性从“HTTP/1.1”替换为“HTTP/2.0”即可,具体配置如下:
<Connector port="8080"protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" >
<UpgradeProtocolclassName=”org.apache.coyote.http2.Http2Protocol” />
<Connector/>
如何设置SSL安全协议呢?HTTP/2.0支持TLS和非TLS两种安全协议。
<Connector port="8443"protocol="HTTP/1.1"
maxTHreads=”150” SSLEnabled=”true”
sslImplementationName=”org.apache.tomcat.util.net.openssl.OPenSSLImplementation”>
<UpgradeProtocolclassName=”org.apache.coyote.http2.Http2Protocol” />
<SSLHostConfig>
<Cretificate certificateKeyFile=”conf/key.pem”
certificateFile=”conf/cerf.pem”
certificateChainFile=”conf/chain.pem”type=”RSA”
/>
</ SSLHostConfig>
<Connector/>