7

JBoss を実行するサーバーがあります。そのサーバーへの間違った URL を入力すると、次のようなバージョンが表示されます: JBossWeb/2.0.1.GA - JBoss のどのバージョンになりますか? JBoss にインストールできるように、SSL 証明書が購入されて提供されます。JBoss に準備完了の SSL 証明書をインストールする方法や情報をいただければ幸いです。この SSL 証明書を SSL 証明書を販売している他の会社から購入する場合、openssl でファイルを生成する必要がありますか?

助けてくれてありがとう。

4

2 に答える 2

6

独自の 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"
/>

最後に、2 つのシステム プロパティを Jboss 起動コマンドに追加して、javax.net.ssl ライブラリが新しいキーストアを使用するようにします。これらは、SSL コールを自分自身に戻す必要がある場合にのみ必要です。CAS と、CAS で認証する 3 つのアプリがすべて同じ開発 Jboss インスタンスで実行されていたため、それらが必要でした。

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

よし、ブラウズするhttp://localhost:8443/

ブラウザは、自己署名証明書について不平を言うでしょう。ブラウザの指示に従って、この証明書をセキュリティ例外として追加するだけで、再度プロンプトが表示されなくなり、すべて完了です。

于 2013-06-30T21:00:22.377 に答える