我有一个运行JBoss的服务器。当我输入到那个服务器的错误网址时,它会给出这样的版本: JBossWeb/2.0.1.GA -那是什么版本的JBoss?将购买一个SSL证书,并为我提供,这样我就可以在JBoss中安装它。我真的很感激任何如何或任何信息如何在JBoss上安装就绪的SSL证书。当此SSL证书将从其他销售SSL证书的公司购买时,我是否需要使用openssl生成任何文件?
提前感谢您的帮助。
发布于 2013-07-01 05:00:22
您可以生成自己的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 everywhere。对于第一个问题,回答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"
/>最后,将两个系统属性添加到Jboss启动命令中,以使javax.net.ssl库使用新的密钥库。只有当您需要回调SSL时才需要它们。我需要它们,因为我有CAS和3个应用程序都在同一个dev Jboss实例中通过CAS身份验证:
-Djavax.net.ssl.trustStore=C:\jboss-2.0.1.GA\server\default\conf\localhost.keystore
-Djavax.net.ssl.trustStorePassword=changeit好的,现在浏览到http://localhost:8443/
你的浏览器会抱怨有一个自签名证书。只需按照浏览器的说明将此证书添加为安全例外,这样您就不会再次收到提示,您就完成了所有操作。
发布于 2019-01-11 22:35:54
我知道这篇文章很老了,但我想分享一个更新版本的Wildfly (早期的JBoss)所需的步骤。
首先,您需要创建自签名证书。如果你已经有一个密钥库,你可以跳过这个步骤。
转到Wildfly/ Jboss主文件夹,创建一个名为"keystore"
jbossWildfly并单击“确定”,然后插入将用于解锁此别名的密码。我强烈建议您将此数据保存在您的computer.keystore.jks将其保存在我们之前创建的keystore文件夹中,然后插入一个新密码,该密码将用于解锁keystore。如果需要,您可以使用与前一个相同的版本。现在打开位于以下位置的standalone.xml文件:
$WILDFLY_HOME$\standalone\configuration
并在<security-realms>标记内添加一个新的安全领域:
<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>再次将$WILDFLY_HOME$更改为指向主目录的实际路径,并将密码更改为您键入的密码。
现在,您需要将新的安全领域分配给default-server的HTTPS侦听器:
<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>请记住,默认情况下,HTTPS侦听器绑定到8443端口:
<socket-binding name="https" port="${jboss.https.port:8443}"/>所以你对服务器的调用应该是这样的:(在localhost上访问)
https://localhost:8443/希望它能有所帮助!:)
https://stackoverflow.com/questions/17394478
复制相似问题