posts - 23,comments - 12,trackbacks - 0
          1、創建證書鑰匙庫:

          keytool -genkey -alias tomcat -keyalg RSA

          缺省證書文件名為:.keystore

          2、修改文件server.xml
            <Connector port="8443"
                         maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                         enableLookups="false" disableUploadTimeout="true"
                         acceptCount="100" debug="0" scheme="https" secure="true"
                         clientAuth="false"
                keystoreFile="C:\keystore\.keystore"
                keystorePass="netscape"
                sslProtocol="TLS" />

          3、web.xml
          <security-constraint>
              <web-resource-collection>
                <web-resource-name>Purchase</web-resource-name>
                <url-pattern>/ssl/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                <role-name>registered-user</role-name>
              </auth-constraint>
              <user-data-constraint>
                <transport-guarantee>CONFIDENTIAL</transport-guarantee>
              </user-data-constraint>
            </security-constraint>
           
            <!-- Only users in the administrator role can access
                 the delete-account.jsp page within the admin
                 directory. -->
            <security-constraint>
              <web-resource-collection>
                <web-resource-name>Account Deletion</web-resource-name>
                <url-pattern>/admin/delete-account.jsp</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                <role-name>administrator</role-name>
              </auth-constraint>
            </security-constraint>
           
            <!-- Tell the server to use form-based authentication. -->
            <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                <form-login-page>/admin/login.jsp</form-login-page>
                <form-error-page>/admin/login-error.jsp</form-error-page>
              </form-login-config>
            </login-config>
             
           
          4、重啟tomcat


          posted on 2005-11-02 15:21 my java 閱讀(404) 評論(0)  編輯  收藏 所屬分類: jsp

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 鄱阳县| 萍乡市| 阿拉尔市| 南京市| 杭州市| 南溪县| 迁西县| 平山县| 克东县| 罗定市| 德惠市| 景宁| 丹凤县| 潮安县| 彰武县| 香格里拉县| 南江县| 太仓市| 合山市| 家居| 缙云县| 伊宁县| 库伦旗| 周宁县| 阳东县| 色达县| 工布江达县| 扬州市| 马鞍山市| 高台县| 安塞县| 通州区| 石景山区| 富蕴县| 聂拉木县| 醴陵市| 连江县| 遵化市| 江北区| 阜阳市| 时尚|