posts - 35,  comments - 7,  trackbacks - 0

创建一个密钥文件,
%JAVA_HOME%/bin/keytool -genkey -alias myalias   -keyalg RSA  -validity 3650 -keystore ./mykeystorefilename

修改conf/server.xml,打开Tomcat的HTTPS端口,
    <Connector port="8443"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               keystoreFile="mykeystorefilepath" 
               keystorePass="mykeystorepassword" >
      <Factory clientAuth="false" protocol="TLS" />
    </Connector>
   
在应用中修改web.xml,增加授权区
<security-constraint>
        <web-resource-collection>
                <url-pattern>/*</url-pattern>
                <http-method>GET</http-method>
                <http-method>POST</http-method>
        </web-resource-collection>
        <user-data-constraint>
                <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
</security-constraint>

posted on 2006-01-21 21:32 java小记 阅读(166) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

<2006年1月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜