2013-06-30 185 views
5

我有一臺運行JBoss的服務器。當我輸入錯誤的URL給該服務器時,它會給我這樣的版本:JBossWeb/2.0.1.GA--這將是什麼版本的JBoss? SSL證書將被購買並提供給我,以便我可以將它安裝在JBoss中。我非常感謝任何HOWTO或任何有關如何在JBoss上安裝SSL證書的信息。當這個SSL證書將從其他銷售SSL證書的公司購買時,是否需要使用openssl生成任何文件?在JBoss上安裝SSL證書

在此先感謝您的幫助。

回答

4

您可以生成自己的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" 
/> 

最後添加兩個系統屬性到JBoss的啓動命令來獲得的javax.net.ssl庫使用新的密鑰庫。只有在您需要將SSL調用回自己時,才需要這些。我需要他們,因爲我有CAS和3級的應用程序在同一個開發Jboss的實例CAS所有正在運行的驗證:

-Djavax.net.ssl.trustStore=C:\jboss-2.0.1.GA\server\default\conf\localhost.keystore 
-Djavax.net.ssl.trustStorePassword=changeit 

OK現在瀏覽http://localhost:8443/

您的瀏覽器會抱怨自簽名證書。只需按照瀏覽器的說明將此證書添加爲安全性異常,這樣就不會再提示您並且全部完成。

+0

使用強密碼處理擊鍵文件很重要嗎?這將在生產系統上配置,不僅用於本地使用。如果我有從CA購買的證書,這些步驟將會如何改變? – Teddy