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 閱讀(409) 評論(0)  編輯  收藏 所屬分類: jsp

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


          網站導航:
           
          主站蜘蛛池模板: 甘肃省| 宝山区| 平罗县| 涿州市| 凤庆县| 辰溪县| 洞头县| 翁源县| 巫溪县| 罗甸县| 康马县| 宁化县| 南岸区| 马关县| 聂荣县| 巴马| 中方县| 利津县| 郯城县| 余干县| 诏安县| 克拉玛依市| 庆元县| 和政县| 张掖市| 桂东县| 酉阳| 东安县| 彭阳县| 宿州市| 巴塘县| 汾阳市| 扶沟县| 仙游县| 钟山县| 天水市| 板桥市| 五原县| 丰县| 浦东新区| 泰兴市|