原创  tomcat配置ssl 收藏

环境:windows xp,tomcat5.0,jdk1.4.2

先要生成服务器端的证书:

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \
  -keystore tomcat.keystore
拷贝文件到tomcat安装路径conf目录下
修改server.xml,注意添加后面keystoreFile和keystorePass的值
<Connector port="443" 
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" debug="0" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" keystoreFile="/conf/bmp.keystore" keystorePass="123456" />
 
在开发web的应用中,修改web.xml就可以使用ssl了
<security-constraint>
  <web-resource-collection>
   <web-resource-name>Protected Area</web-resource-name>
   <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
   <description>SSL</description>
   <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
 </security-constraint>

发表于 @ 2006年03月30日 15:17:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:一个完整的TableViewer实例 | 新一篇:打印网页时怎么去掉页眉页脚

  • 发表评论
  • 评论内容:
  •  
Copyright © ebookbug
Powered by CSDN Blog