認証局に提出する署名リクエストの生成方法。
■Private Key
openssl genrsa -des3 2048 > your.domain.key
Generating RSA private key, 2048 bit long modulus ...................+++ .................+++ e is 65537 (0x10001) Enter pass phrase: Verifying - Enter pass phrase:
パスフレーズが埋め込まれたもの
AWSのconsoleに貼り付ける時に必要になる。
openssl rsa < your.domain.key > your.domain.key.pass
■Certificate Signing Request
認証局に提出する。
openssl req -new -key your.domain.key -out your.domain.csr -sha1
Enter pass phrase for your.domain.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]:JP State or Province Name (full name) [Some-State]:Tokyo Locality Name (eg, city) []:Sibuya-ku Organization Name (eg, company) [Internet Widgits Pty Ltd]:Hoge Inc. Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:your.domain.net Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
Common Nameが証明するhost名となるようにし、全てのサブドメインを証明するような証明書を取得する場合は*.your.domain.netとする。
■Public Key Certificate
認証局(CA)が発行する証明書。
■Certificate Chain
RapidSSLのIntermediate Certificatesはウェブで参照する。
参考
Apacheの設定
以下のコマンドで必要なモジュールをインストールする。
sudo yum install mod_ssl
以下のコマンドで設定ファイルを編集する。
sudo vim /etc/httpd/conf.d/ssl.conf
以下の部分で証明書のファイルへのパスを記述する。
SSLCertificateFile /etc/httpd/ssl/your.domain.public.cert SSLCertificateKeyFile /etc/httpd/ssl/your.domain.key.pass SSLCertificateChainFile /etc/httpd/ssl/your.domain.intermediate.cert
VirtualHostなどを設定したら、以下のコマンドで再読込する。
sudo /usr/sbin/apachectl configtest sudo /etc/init.d/httpd reload