tomcat配置强制https访问

tomcat配置强制https访问

绿林寻猫
2021-12-08 / 0 评论 / 195 阅读 / 正在检测是否收录...

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

示例:

0

评论 (0)

取消