HTTP请求自动跳转HTTPS请求

HTTP请求自动跳转HTTPS请求

要想使HTTP请求自动跳转到HTTP请求,需要同时打开tomcat的80端口和443端口,然后配置config/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>

相关推荐