【发布时间】:2016-01-21 22:39:42
【问题描述】:
我已经完成了将 SSL 证书添加到 glassfish v4 的步骤。我已经验证它可以通过浏览器和我的 java swing 客户端工作(我在客户端使用 apache 的 http 客户端库)
管理控制台不起作用!自从成功导入 SSL 后,我无法再连接到管理控制台 http://www.myhost.com:4848,我仍然看到登录屏幕,一直有效的管理员用户名/密码组合已停止工作。我在尝试从 netbeans 部署 Web 应用程序时也注意到了一些问题,但我还没有研究足够多的东西来知道它是否是同一个问题。
以下是我添加 ssl 证书的步骤。这些是直接从 glassfish v4 安全指南 p1-26 到 p1-29 中提取的。我确实添加了一个更改主密码的步骤,但我应该早点这样做,但我把它包括在这里。为了我的隐私,我还在以下步骤中省略或更改了某些文件夹名称,但除此之外,我已从终端应用程序中复制了所有这些名称。
有人知道管理员出了什么问题吗?需要注意的一件事 - 遵循 glassfish 的管理员和安全指南说我可以重写 s1as 别名。您会注意到我在以下步骤中使用证书时使用了该别名
提前感谢您的帮助!
第 1 步 - 停止服务器
/usr/home/myhost
110 % glassfish4/bin/asadmin stop-domain domain1
Waiting for the domain to stop .
Command stop-domain executed successfully.
第 2 步 - 更新主密码
/usr/home/myhost
110 % glassfish4/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin> change-master-password domain1
Enter the current master password>
Enter the new master password>
Enter the new master password again>
Command change-master-password executed successfully.
asadmin> exit
Command multimode executed successfully.
第 3 步 - 切换到密钥文件目录
/usr/home/myhost
111 % cd glassfish4/glassfish/domains/domain1/config/
第 4 步 - 从密钥库中删除 s1as
/usr/home/myhost/glassfish4/glassfish/domains/domain1/config
113 % keytool -delete -alias s1as -keystore keystore.jks
Enter keystore password:
第 5 步 - 生成新的密钥对
/usr/home/myhost/glassfish4/glassfish/domains/domain1/config
114 % keytool -genkey -alias s1as -keyalg RSA -keystore keystore.jks -keysize 2048
Enter keystore password:
What is your first and last name?
[Unknown]: www.myhost-dev.com
What is the name of your organizational unit?
[Unknown]: development
What is the name of your organization?
[Unknown]: myhost, inc
What is the name of your City or Locality?
[Unknown]: mycity
What is the name of your State or Province?
[Unknown]: mystate
What is the two-letter country code for this unit?
[Unknown]: us
Is CN=www.myhost-dev.com, OU=development, O="myhost, inc", L=mycity, ST=mystate, C=us correct?
Enter key password for <s1as>
(RETURN if same as keystore password):
第 6 步 - 生成证书签名请求 (CSR)
/usr/home/myhost/glassfish4/glassfish/domains/domain1/config
115 % keytool -certreq -alias s1as -file toSymantec02.csr -keystore keystore.jks
Enter keystore password:
第 7 步 - 向 symantec 提交 CSR
第 8 步 - 将中间证书和 ssl 证书从 symantec 复制到配置目录中
第 9 步 - 导入中间证书
/usr/home/myhost/glassfish4/glassfish/domains/domain1/config
115 % keytool -import -trustcacerts -alias Intermediate -keystore keystore.jks -file IntermediateCA.crt
Enter keystore password:
Certificate was added to keystore
第 10 步 - 导入 ssl 证书
/usr/home/myhost/glassfish4/glassfish/domains/domain1/config
116 % keytool -import -trustcacerts -alias s1as -keystore keystore.jks -file ssl_certificate.crt
Enter keystore password:
Certificate reply was installed in keystore
第 11 步 - 重启服务器
/usr/home/myhost
118 % glassfish4/bin/asadmin start-domain domain1
Enter master password (3) attempt(s) remain)>
Waiting for domain1 to start ...............................
Successfully started the domain : domain1
domain Location: /usr/home/myhost/glassfish4/glassfish/domains/domain1
Log File:/usr/home/myhost/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
【问题讨论】: