Let’s Encryptで発行した証明書がwww無しドメイン用で先頭にwww.を付けるとSSL証明書の警告が表示されてしまうので、対応しました。
以下はexample.com用のSSL証明書をwww.example.comにも対応させる例です。
./certbot-auto certonly --webroot -d example.com -d www.example.com
------------------------------------------------------------------------------- You have an existing certificate that contains a portion of the domains you requested (ref: /etc/letsencrypt/renewal/example.com.conf) It contains these names: example.com You requested these names for the new certificate: example.com, www.example.com. Do you want to expand and replace this existing certificate with the new certificate? ------------------------------------------------------------------------------- (E)xpand/(C)ancel: E Renewing an existing certificate Performing the following challenges: http-01 challenge for example.com http-01 challenge for www.example.com Select the webroot for example.com: ------------------------------------------------------------------------------- 1: Enter a new webroot ------------------------------------------------------------------------------- Press 1 [enter] to confirm the selection (press 'c' to cancel): 1 Input the webroot for example.com: (Enter 'c' to cancel):/var/www/html Select the webroot for www.example.com: ------------------------------------------------------------------------------- 1: Enter a new webroot 2: /var/www/html ------------------------------------------------------------------------------- Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2 Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/eiyoukeisan.com/fullchain.pem. Your cert will expire on 2017-09-17. To obtain a new or tweaked version of this certificate in the future, simply run certbot-auto again. To non-interactively renew *all* of your certificates, run "certbot-auto renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le