一、修改server.xml文件
修改:
1、配置证书
2、配置域名
二、修改web文件(配置强制跳转)
强制跳转到https:
打开conf下的web.xml 将下面这段配置加到</welcome-file-list>后面:
<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>
重启tomca进行验证
有问题请加博主微信进行沟通!
全部评论