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

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


          網站導航:
           
          主站蜘蛛池模板: 上虞市| 达拉特旗| 来凤县| 芷江| 财经| 获嘉县| 明星| 桃江县| 班戈县| 固安县| 含山县| 安陆市| 和政县| 江孜县| 寿宁县| 社旗县| 平和县| 太湖县| 乌拉特中旗| 望城县| 明溪县| 彭水| 洛隆县| 宜城市| 北京市| 商南县| 东阿县| 舒兰市| 囊谦县| 柘城县| 灌云县| 易门县| 铜陵市| 犍为县| 镇宁| 阿拉善左旗| 平潭县| 古田县| 大理市| 石林| 澜沧|