如果是想找tomcat设置Https访问可以看我的这篇博客
tomcat服务器设置Https访问
这一篇解决的是设置了Https后让浏览器在发送http请求后自动转成https请求
进入tomcat目录,找到并进入conf文件夹,找到web.xml并修改
进入文档末尾,在红色方框部分添加代码
<login-config>
<!-- Authorization setting for SSL -->
<auth-method>CLIENT-CERT</auth-method>
<realm-name>Client Cert Users-only Area</realm-name>
</login-config>
<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>
修改完之后哪怕你输入http请求,浏览器也会自动变成https请求