本文以tomcat演示:
1.申领证书
http://zhangge.net/4890.html
2.安装证书
http://zhangge.net/4861.html
ps:keystoreFile 必须为全路径
keystorePass 必填
port 443
其他8443端口都改为443
(https 默认端口为443)
3.实现访问http自动跳转到https
打开$CATALINA_HOME/conf/web.xml,在该文件末尾增加:
<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>
4.重启tomcat
转载于:https://my.oschina.net/vshcxl/blog/706145