CSR を作るには?

ショコラ
ショコラ

CSR を作るには?

「openssl req -new -key {秘密鍵} -out {ホスト名}.csr」でキメマス。
秘密鍵 を作成してから CSR を作成する。

サーバー証明書を設定するまでの流れ
①秘密鍵を作成
②パスワード解除した秘密鍵を作成 ←スロー
③csrを作成 ←ここの話
④サーバー証明書取得
⑤サーバーにサーバー証明書を設定

もっさん先輩
もっさん先輩
openssl req -new -key {秘密鍵} -out {ホスト名}.csr

手順

  1. 秘密鍵を作成します。
openssl genrsa -des3 -out {ホスト名}.key 2048

ポイントは末尾にある 2048 です。

秘密鍵にパスワードを設定します。

# openssl genrsa -des3 -out {ホスト名}.key 2048
Generating RSA private key, 2048 bit long modulus
.......+++
...........................................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for answorz.com.key:{パスワード入力}
Verifying - Enter pass phrase for answorz.com.key:{パスワード入力}
  1. CSRを作成します。
openssl req -new -key {秘密鍵} -out {ホスト名}.csr

秘密鍵に設定したパスワードを入力します。あとは質問に答え終われば CSR が作成されます。

Enter pass phrase for {ホスト名}.key:{パスワード入力}
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:{国}
State or Province Name (full name) [Some-State]:{都道府県}
Locality Name (eg, city) []:{市区群}
Organization Name (eg, company) [Internet Widgits Pty Ltd]:{会社の名前}
Organizational Unit Name (eg, section) []:{部署名}
Common Name (e.g. server FQDN or YOUR name) []:{ホスト名}
Email Address []:{メールアドレス}

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:{無しでOK}
An optional company name []:{無しでOK}

以上

  1. 秘密鍵を作成します。
openssl genrsa -des3 -out answorz.com.key 2048
# openssl genrsa -des3 -out answorz.com.key 2048
Generating RSA private key, 2048 bit long modulus
.......+++
...........................................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for answorz.com.key:123456
Verifying - Enter pass phrase for answorz.com.key:123456
  1. CSRを作成します。
openssl req -new -key answorz.com.key -out answorz.com.csr
# openssl req -new -key answorz.com.key -out answorz.com.csr
Enter pass phrase for answorz.com.key:1234567890
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Tokyo
Locality Name (eg, city) []:Bunkyo-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Answorz Co., Ltd.
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:answorz.com
Email Address []:mossan@answorz.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:{無しでOK}
An optional company name []:{無しでOK}

以上

Scroll to Top