ワイルドカードSSLを取得する際にCommon Nameの書き方で迷ったことがありますので、今回はワイルドカードSSLのCSR作成方法を書こうと思います。特に複雑なことなどはありませんので、個人的な備忘録です。
まずは、秘密鍵を生成します。今回取得するワイルドカードSSLのドメインをpoitan.jpとし、入力箇所は太字で記述します。
# cd /etc/httpd/conf # openssl genrsa -des3 -out ./ssl.key/poitan.jp.key 2048 .........................................+++ .................................................++++ e is 65537 (0x10001) Enter pass pharase for ./ssl.key/poitan.jp.key: パスワード Verifying - Enter pass phrase for ./ssl.key/poitan.jp.key: パスワード
次にCSRを作成します。注意点はCommon Nameを「*.poitan.jp」とすることです。「poitan.jp」等を指定すると「CSR does not contain a wildcard domain as expected」とエラーメッセージが表示されます。
# openssl req -new -key ./ssl.key/poitan.jp.key -out ./ssl.csr/poitan.jp.csr 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) [XX]:JP State or Province Name (full name) []:Tokyo Locality Name (eg, city) [Default City]:Chuo-ku Organization Name (eg, company) [Default Company Ltd]:POITAN Organizational Unit Name (eg, section) []:Engineering Department Common Name (eg, your name or your server's hostname) []:*.poitan.jp Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
Webサーバの設定に関しては通常の設定で問題ありません。RapidSSLを使っている場合は「RapidSSLのクロスルート設定」もご覧ください。