server.xml
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="1000" minSpareThreads="100"/>
<Connector executor="tomcatThreadPool"
port="80" protocol="HTTP/1.1" enableLookups="false"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
keystoreFile="cert/m.1jdj.cn.jks" keystorePass="aa123456"
maxThreads="500" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
//--------------------------------------------------------------------------------------------
web.xml http自动跳转https 文件末尾加
<security-constraint>
<web-resource-collection >
<web-resource-name >SSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

本文介绍如何在Tomcat服务器中配置HTTPS服务,包括设置SSL证书、指定加密协议及端口等参数,并通过web.xml实现从HTTP到HTTPS的自动跳转。
656

被折叠的 条评论
为什么被折叠?



