http转成https

 

 1.在阿里云服务器上购买一个AC证书,将证书下载下来


2.解压放在tomcat目录下,cert文件夹是我自己建的




3.修改tomcat的配置文件上面那个原来是被注掉的放开 


把端口改为443,https请求的是的443端口


如果你存在http://请求想让他转化为https://请求在web.xml文件后面加上

 



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

 



就好了 

 

posted @ 2017-01-19 20:21  这个名字想了很久~  阅读(754)  评论(0编辑  收藏  举报