文件位置:tomcat/conf/server.xml 修改为: <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" URIEncoding="UTF-8" /> <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" keystoreFile="confcert***.***.***.jks" keystorePass="z5166825awh8sg6"/> <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
解释:
keystoreFile:证书文件位置 根据自己的文件改名字
keystorePass:私钥密码
文件位置:tomcat/conf/web.xml 加入: <security-constraint> <!-- Authorization setting for SSL --> <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>