在JBoss上安装SSL证书
我有一台运行JBoss的服务器。当我在那个服务器上输入错误的URL时,它会给我这样的版本:JBossWeb/2.0.1.GA-那将是什么版本的JBoss?SSL证书将被购买并提供给我,以便我可以在JBoss中安装它。我非常感谢您提供如何在JBoss上安装ready SSL证书的信息。当这个SSL证书将从其他销售SSL证书的公司购买时,我需要用openssl生成任何文件吗在JBoss上安装SSL证书,ssl,jboss,installation,certificate,ssl-certificate,Ssl,Jboss,Installation,Certificate,Ssl Certificate,我有一台运行JBoss的服务器。当我在那个服务器上输入错误的URL时,它会给我这样的版本:JBossWeb/2.0.1.GA-那将是什么版本的JBoss?SSL证书将被购买并提供给我,以便我可以在JBoss中安装它。我非常感谢您提供如何在JBoss上安装ready SSL证书的信息。当这个SSL证书将从其他销售SSL证书的公司购买时,我需要用openssl生成任何文件吗 提前感谢您的帮助。您可以生成自己的SSL证书: 首先,您需要创建一个自签名证书。您可以使用Java附带的keytools应用程
提前感谢您的帮助。您可以生成自己的SSL证书: 首先,您需要创建一个自签名证书。您可以使用Java附带的keytools应用程序来实现这一点。打开命令提示符并运行以下命令。您需要更改Jboss conf目录的路径以反映您的安装:
C:\>keytool -genkey -alias tomcat -keyalg RSA -keystore C:\jboss-2.0.1.GA\server\default\conf\localhost.keystore
出现提示时,请在任何地方使用changeit密码。请回答localhost的第一个问题,这一点很重要:
Enter keystore password: changeit
Re-enter new password: changeit
What is your first and last name?
[Unknown]: localhost
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]: NZ
Is CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=NZ correct?
[no]: yes
Enter key password for
(RETURN if same as keystore password): changeit
Re-enter new password: changeit
Next up you need to configure tomcat to create a SSL connector.
Edit C:\jboss-2.0.1.GA\server\default\deploy\jboss-web.deployer\server.xml and find the commented out SSL connector example, uncomment it and tweak it as follows:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="${jboss.server.home.dir}/conf/localhost.keystore"
keystorePass="changeit"
/>
现在浏览到http://localhost:8443/
您的浏览器将投诉自签名证书。只需按照浏览器的说明将此证书添加为安全例外,这样您就不会再次收到提示,一切都完成了。我知道这篇文章已经很老了,但是我想分享一下更新版本的Wildfly(早期的JBoss)所需的步骤 首先,您需要创建自签名证书。如果已经有密钥库,可以跳过此步骤
- 转到Wildfly/Jboss主文件夹,创建一个名为“keystore”的新目录
- 下载应用程序
- 打开它并选择“创建新密钥库”
- 在出现的对话框中,选择JKS。在大多数情况下,这是好的,但在其他平台 例如,在Android上,您需要使用BKS格式类型
- 现在右键单击并选择“创建新密钥对”。您可以安全地接受默认设置。 (RSA/2048)
- 在出现的对话框中,根据需要对其进行自定义。无论如何,我建议使用 版本3和带有RSA的SHA-256李>
- 单击对话框右下角区域中对应的“编辑名称”按钮 到名称字段。填写所有字段并单击“确定”
- 在另一个对话框上单击“确定”
- 现在将要求为别名插入neme。键入
并单击ok,然后 插入将用于解锁此别名的密码我强烈建议 将此数据保存在计算机中的某个位置。jbossWildfly
- 现在您已经成功地生成了密钥对。在我们之前创建的keystore文件夹中,用名称
保存它,然后插入一个新密码 将用于解锁密钥库。如果需要,您可以使用与之前相同的 你想要的keystore.jks
standalone.xml
文件:
$WILDFLY\u HOME$\standalone\configuration
并在
标记中添加一个新的安全域:
<security-realm name="MyNewSecurityRealm">
<server-identities>
<ssl>
<keystore path="$WILDFLY_HOME$\keystore\keystore.jks" keystore-password="keystore_password" alias="jbossWildfly" key-password="alias_password"/>
</ssl>
</server-identities>
</security-realm>
希望能有所帮助!:) 为击键文件使用强密码是否重要?这将在生产系统上配置,而不仅仅用于本地使用。如果我有从CA购买的证书,这些步骤将如何改变?
<security-realm name="MyNewSecurityRealm">
<server-identities>
<ssl>
<keystore path="$WILDFLY_HOME$\keystore\keystore.jks" keystore-password="keystore_password" alias="jbossWildfly" key-password="alias_password"/>
</ssl>
</server-identities>
</security-realm>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<https-listener name="https" socket-binding="https" security-realm="MyNewSecurityRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<http-invoker security-realm="MyNewSecurityRealm"/>
</host>
</server>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
https://localhost:8443/