https://certbot.eff.org/docs/using.html
http://www.mumpk.com/tech/2015/12/21/get-certificate-with-lets-encrypt/
Let’s Encrypt サーバー証明書の取得と自動更新設定メモ | あぱーブログ
HTTP-01
Webroot プラグインは ${webroot-path}/.well-known/acme-challenge に一時ファイル(ワンタイムトークン)を作成し、Let's Encrypt の認証サーバから HTTP リクエスト(名前解決には DNS のAレコードを使用)で取得することにより、認証を行います。
http://serverfault.com/questions/575924/apache-2-4-public-subdirectory-with-htaccess
https://httpd.apache.org/docs/current/mod/mod_authn_core.html#authtype
AuthType Basic AuthName Documents AuthBasicProvider file AuthUserFile "/usr/local/apache/passwd/passwords" Require valid-user AuthType None Require all granted
私たちの HTTP-01 チャレンジの実装は、リダイレクトを最大 10 回まで追跡します。 追跡されるのは、“http:” から “https:” へのリダイレクトで、80 番ポートから 443 番ポートへのリダイレクトのみです。 IP アドレスへのリダイレクトは許可されません。 HTTPS URL へのリダイレクトである場合、証明書の検証は行いません (というのも、このチャレンジは、有効な証明書のブートストラップを意図したものであり、HTTPS URL へのリダイレクトの場合、途中で自己署名証明書や有効期限切れの証明書が存在する可能性があるためです)。
DNS-01
http://blog.jicoman.info/2017/04/certbot_dns_01/
AWS Route53を使ってDNS-01でLet's Encryptの証明書を取得する - まーぽんって誰がつけたの?
https://github.com/certbot/certbot/blob/master/certbot-dns-route53/examples/sample-aws-policy.json
(Route53をcliで操作)
http://gihyo.jp/admin/serial/01/ubuntu-recipe/0334
https://qiita.com/kt_higa/items/b58b812add835326a93f
ワイルドカード証明書取得
certbot certonly --manual \ --server https://acme-v02.api.letsencrypt.org/directory \ --preferred-challenges dns \ -d *.example.com -d example.com \ -m sample@example.com \ --agree-tos \ --manual-public-ip-logging-ok
更新の設定ファイル
更新の設定ファイルは /etc/letsencrypt/renewal/*.conf
http://blog.apitore.com/2016/08/06/lets-encrypt-standalone-webroot/
hook
/etc/letsencrypt/renewal-hooks/post
証明書の失効
sudo certbot revoke --cert-pat=/etc/letsencrypt/live/xxx.home.com/cert.pem
revokeでファイルを消すかも聞かれる
ファイル権限
/etc/letsencrypt/setprivkeyperms.sh #!/bin/bash find /etc/letsencrypt/archive -type f -perm 0644 -name 'privkey*.pem' -exec chmod 600 {} +
haproxy 鍵と証明書のバンドル
Apache 2.4.8 未満 SSLEngine on SSLCertificateFile /etc/letsencrypt/live/[ドメイン名]/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/[ドメイン名]/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/[ドメイン名]/chain.pem Apache 2.4.8 以上 SSLEngine on SSLCertificateFile /etc/letsencrypt/live/[ドメイン名]/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/[ドメイン名]/privkey.pem