【发布时间】:2019-03-10 07:08:00
【问题描述】:
我正在尝试在我的 jboss 7.1.1 应用程序中启用 ssl(https)。以下是我尝试过的步骤
- 从认证提供商处收到 root.crt、中间 .crt 和 servercertificate.crt
-
执行以下命令
keytool -genkey -alias jboss7 -keyalg RSA -keystore [Common Name].keystore -validity 365 keytool -import -trustcacerts -alias root -file [root certificate].crt -keystore [Common Name].keystore keytool -import -trustcacerts -alias intermediate -file [intermediate certificate].crt -keystore [Common Name].keystore keytool -import -trustcacerts -alias server -file [Common Name].crt -keystore [Common Name].keystore -
将生成的密钥库包含在standalone.xml 文件中
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true"> <ssl name="jboss7-ssl" key-alias="jboss7" password="password" certificate-key-file="${jboss.server.config.dir}/server.keystore" protocol="TLSv1"/> </connector>
并重新启动服务器。
我的页面现在加载了https://localhost:8443/project,但它显示
certificate (invalid) and "This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store."
谁能告诉我我造成的错误。
【问题讨论】:
-
您生成了别名为
jboss7的密钥,但您将服务器证书导入了别名server。您必须将服务器证书(或链)导入到私钥别名,即jboss7。另外要清楚的是,您在命令中将文件名显示为[Common Name].keystore,但在XML 中显示为server.keystore;这些必须相同。
标签: java certificate ssl-certificate jboss7.x keytool