jboss ssl配置

来源:互联网 发布:mac 暗黑2 编辑:程序博客网 时间:2024/06/05 23:05

 前提:
在Windows XP/2000/2003 下安装并配置了JDK和
JBoss4.0.5.GA,并能正常使用JBoss。
http://localhost:8080/能够出现Jboss页面。

步骤:
1.生成keystore
开始->运行->cmd
打开控制台,输入
keytool -genkey -alias tomcat -keyalg RSA
根据提示输入对应内容,效果如下:
E:/>keytool -genkey -alias tomcat -keyalg RSA
输入keystore密码:  test123
您的名字与姓氏是什么?
  [Unknown]:  test
您的组织单位名称是什么?
  [Unknown]:  test
您的组织名称是什么?
  [Unknown]:  test
您所在的城市或区域名称是什么?
  [Unknown]:  china
您所在的州或省份名称是什么?
  [Unknown]:  beijing
该单位的两字母国家代码是什么
  [Unknown]:  cn
CN=test, OU=test, O=test, L=china, ST=beijing, C=cn 正确吗?
  [否]:  y

输入<tomcat>的主密码
        (如果和 keystore 密码相同,按回车):

说明:输入的密码不要带特殊字符,否则在运行JBoss时可能会出错。

2.将产生的.keystore(默认路径在“C:/Documents and Settings/用户名”下面)放到JbossHOME/server/default/conf下,重命名为chap8.keystore。

3.打开JbossHOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml,修改如下配置:

<!-- SSL/TLS Connector configuration using the admin devl guide keystore
<Connector port="8443" address="${jboss.bind.address}"
  maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
  emptySessionPath="true"
  scheme="
https" secure="true" clientAuth="false"
  keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
  keystorePass="rmi+ssl" sslProtocol = "TLS" />
-->

<!-- SSL/TLS Connector configuration using the admin devl guide keystore -->
<Connector port="8443" address="${jboss.bind.address}"
  maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
  emptySessionPath="true"
  scheme="https" secure="true" clientAuth="false"
  keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
  keystorePass="test123" sslProtocol = "TLS" />

4.启动Jboss,在浏览器地址栏中分别输入
http://localhost:8080/https://localhost:8443/进行测试。

参考:http://www.i-proving.ca/space/Technologies/JBoss/Configuring+JBoss+SSL

 
原创粉丝点击