Qiitaとの同時投稿
Let's Encrypt を使った SSL 設定 for Amazon Linux – Qiita
Qiita
SSLのサイトを作ってみたくなった
ちょっとした無償サービスを作るにあたって、Let’s Encrypt を使った SSL を試しに使ってみたくてやってみました。
環境は、Amazon Linux。
ざっくりとした手順
$ wget https://dl.eff.org/certbot-auto
$ chmod a+x certbot-auto
$ ./certbot-auto (中略) FATAL: Amazon Linux support is very experimental at present... if you would like to work on improving it, please ensure you have backups and then run this script again with the --debug flag! Alternatively, you can install OS dependencies yourself and run this script again with --no-bootstrap.
Amazon Linux は、–debug をつけろというのでつけました。
$ ./certbot-auto --debug (中略) The following errors were reported by the server: Domain: XXX.XXX.jp Type: connection Detail: Failed to connect to XXX.XXX.XXX.XXX:443 for tls-sni-01 challenge (後略)
よくよく調べると以下に該当。
https://letsencrypt.jp/usage/dvsni-challenge-error.html
セキュリティグループに、443を指定するのを忘れていたので指定して、コンソールからインスタンス再起動。
$ ./certbot-auto renew
インストールが終わったら、httpd を再起動。
$ sudo service httpd graceful
https でアクセスして完了を確認。
参考
Let's Encryptを使ってSSL証明書を自動更新する(AWS/Amazon Linux/Apache) – Qiita
Qiita
チュートリアル: Amazon Linux 2 に SSL/TLS を設定する – Amazon Elastic Compute Cloud
docs.aws.amazon.com


