少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

          1.tomcat下所有應用都強制https訪問

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





          2.單個應用強制https訪問

          WEB-INF/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>




          posted on 2013-01-06 21:28 abin 閱讀(1359) 評論(0)  編輯  收藏 所屬分類: HTTPS
          主站蜘蛛池模板: 海城市| 汶川县| 岑巩县| 新干县| 武乡县| 保山市| 汽车| 江孜县| 涞水县| 扶沟县| 绿春县| 白玉县| 北京市| 遵化市| 布尔津县| 新晃| 开阳县| 宾阳县| 合川市| 广饶县| 航空| 中江县| 呼伦贝尔市| 南召县| 吴桥县| 浠水县| 唐山市| 新兴县| 城市| 莆田市| 弥勒县| 三都| 木兰县| 徐闻县| 雷山县| 贺兰县| 铁岭市| 九台市| 繁峙县| 长泰县| 休宁县|