質問

Java keytoolを使用しようとしているだけですが、ホスト名を設定する方法がわかりません。

これが私が試みている方法です:

hostname[username:/this/is/a/path][640]% keytool -keystore server.keystore -genkeypair -alias hostname
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  hostname
What is the name of your organizational unit?
  [Unknown]:  hostname
What is the name of your organization?
  [Unknown]:  hostname
What is the name of your City or Locality?
  [Unknown]:  hostname
What is the name of your State or Province?
  [Unknown]:  hostname
What is the two-letter country code for this unit?
  [Unknown]:  CA
Is CN=hostname, OU=hostname, O=hostname, L=hostname, ST=hostname, C=CA correct?
  [no]:  yes

Enter key password for <hostname>
        (RETURN if same as keystore password):
hostname[username:/this/is/a/path][641]%

すべてのフィールドをホスト名に設定したので、ホスト名がホスト名に設定されていると仮定できますか?

役に立ちましたか?

解決

cn = hostname-これは、ここで求められている最初のオプションです。 Keytoolがそれを「名と姓」と呼んでいることは混乱しています。

他のヒント

のセクション3.1の「サーバーのアイデンティティ」によると RFC 2818「TLS上のHTTP」, 、クライアントは、サーバー証明書のサブジェクトDN(著名な名前)のCN(共通名)部分をURLのDNSホスト名と比較することになっています。

したがって、ホスト名(keytoolの最初の質問)に共通名(CN)を使用してください。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top