やっぱり自己証明でなく証明してもらおう

自己証明でSSLできるようにしたが、非常に気持ちが悪いのでやっぱり証明してもらうことにする。

とはいえ、お金を払わずに証明してくれるのは、前回の記事に書いた通りCAcert.orgなので、ここで証明してもらうことにした。

証明してもらうための申請データを作成しないといけないので、事前に作成する。

まずは、秘密鍵の生成である。もちろん、パスフレーズも設定する。

続いて、証明書の申請データを作成する。

あっという間にデータが作成できた。

# openssl req -new -key geekwind.net.key -out geekwind.net.csr
Enter pass phrase for geekwind.net.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) [GB]:JP
State or Province Name (full name) [Berkshire]:TOKYO
Locality Name (eg, city) [Newbury]:MINATO
Organization Name (eg, company) [My Company Ltd]:CAcert.org
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:www.geekwind.net
Email Address []:

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

CAcert.orgに登録である。

ちょっと面倒だったのは、パスワードを忘れた場合のリマインダーが5つきっちり入れないと登録できないところである。

ユーザ登録後、サイトを登録し、先ほど生成したgeekwind.net.csrをペロっと貼り付けると、あっさり証明してくれた。

これでオレオレ証明ではない証明書のできあがりである。

しかし、パスフレーズがあると、Webサーバの自動起動に影響があるので、パスフレーズを取り除く処理を行う。
一応、バックアップを取りつつ、パスフレーズを除去。

# mv geekwind.net.key geekwind.net.key.org
# openssl rsa -in geekwind.net.key.org -out geekwind.net.key
Enter pass phrase for geekwind.net.key.org:**********
writing RSA key

# cat geekwind.net.key geekwind.net.crt > geekwind.net.pem

できあがったものをlighttpd.confにセットして、lighttpdの再起動である。

# service lighttpd restart
Stopping lighttpd:                                         [  OK  ]
Starting lighttpd:                                         [  OK  ]

見事にそれっぽくなった。



この記事へのトラックバック

Leave your Comment

メールアドレスが公開されることはありません。

*

★ロリポップ!★WordPressやMovableTypeの簡単インストール、cron、共有SSL対応!


Blue Taste Theme created by Jabox