SSL証明書作成メモ

    • VPSサーバにSSL証明書をインストールするための作業メモ


■証明書関連の作業フォルダ
/etc/pki/tls/certs


擬似乱数ファイル(md5 ダイジェスト値を擬似乱数として使用)を生成
# openssl md5 * > rand.dat


秘密鍵を生成
# openssl genrsa -rand rand.dat -des3 2048 > [KeyFile]


CSRを生成
# openssl req -new -key [KeyFile] -out [CSRFile]


※作成したCSRファイルにてSSL証明書を作成してもらう
※事業者からはCAFile・CertFileを受け取る

■Apach-SSL設定ファイル(ssl.conf など)
証明書ファイル
SSLCertificateFile /usr/local/ssl/certs/[CertFile]
秘密鍵ファイル
SSLCertificateKeyFile /usr/local/ssl/private/[KeyFile]
中間CA証明書
SSLCACertificateFile /usr/local/ssl/certs/[CAFile]



秘密鍵の内容を確認
# openssl rsa -text -noout -in [KeyFile]
秘密鍵パスフレーズを解除
# cp [KeyFile] [KeyFile].org (元ファイルのバックアップ)
# openssl rsa -in [KeyFile] -out [KeyFile]
CSRの内容を確認
# openssl req -text -noout -in [CSRFile]
証明書の内容を確認
# openssl x509 -text -noout -in [CertFile]