Tomcat设置Http自动跳转Https

Https相关介绍

    Https是由NetScape公司设计的一个基于Http的加密传输协议,可以这样理解Https = Http +SSL(安全套接层),Https的默认端口为443,而且还需要申请CA数字证书认证。

Http自动跳转Https

  编辑conf/web.xml文件:

  在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>

然后 :wq保存并退出

posted @ 2018-11-27 16:51  Digital丶  阅读(771)  评论(0编辑  收藏  举报