1.在阿里云服务器上购买一个AC证书,将证书下载下来
2.解压放在
tomcat目录下,cert文件夹是我自己建的
![](https://images2015.cnblogs.com/blog/1000885/201701/1000885-20170119201635281-528302711.png)
3.修改tomcat的配置文件
上面那个原来是被注掉的放开
![](https://images2015.cnblogs.com/blog/1000885/201701/1000885-20170119201745375-2115442745.png)
把端口改为443,https请求的是的443端口
如果你存在http://请求想让他转化为https://请求在web.xml文件后面加上![](file:///D:Program FilesTencentQQUsers809756906ImageC2CRL(23$SXY3YLHUDIV)M5XUP.png)
就好了
2.解压放在
![](file:///D:Program FilesTencentQQUsers809756906ImageC2CA%B49YR1FKPM)]T4FY~9G`E.png)
![](https://images2015.cnblogs.com/blog/1000885/201701/1000885-20170119201635281-528302711.png)
3.修改tomcat的配置文件
![](file:///D:Program FilesTencentQQUsers809756906ImageC2C{A`L9[Z)~W]4)KF_YY6SPG3.png)
![](https://images2015.cnblogs.com/blog/1000885/201701/1000885-20170119201745375-2115442745.png)
把端口改为443,https请求的是的443端口
如果你存在http://请求想让他转化为https://请求在web.xml文件后面加上
![](file:///D:Program FilesTencentQQUsers809756906ImageC2CRL(23$SXY3YLHUDIV)M5XUP.png)
![](https://images2015.cnblogs.com/blog/1000885/201701/1000885-20170119201836468-1150387644.png)
<login-config> <auth-method>CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <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>
就好了