nginx で SSL 証明書を作成したときの手順
秘密鍵の生成
# cd /etc/ssl # openssl sha1 /var/log/messages > rand.dat # ls openssl.conf rand.dat # openssl genrsa -rand rand.dat -des3 2048 > 20101128_key_with_pass.pem 66 semi-random bytes loaded Generating RSA private key, 2048 bit long modulus .........................................................................................+++ ............................................+++ e is 65537 (0x10001) Enter pass phrase: Verifying - Enter pass phrase:
秘密鍵からパスワードを抜く
サーバーそのものの再起動や nginx の再起動でもパスワードの入力を求められるので、秘密鍵からパスワードを抜いてしまう。
# openssl rsa -in 20101128_key_with_pass.pem -out 20101128_key.pem
X.509 証明書の生成
# openssl x509 -in 20101128_csr.pem -req -signkey 20101128_key.pem -out 20101128.pem