当部署 certbot 成功后,剩下的任务就是通读官方文档,以解决各种问题:
Welcome to the Certbot documentation! — Certbot 1.15.0.dev0 documentation
博客笔记都是静态页面,用不用 HTTPS 都可以,但是大家都在用…………所以尝尝味道嘛,反正也买不起证书…………而且用这东西只是早晚的事情。
该笔记将记录:如何申请免费证书来启用 HTTPS 站点。
在证书自动续期后,自动重启相关服务
User Guide — Certbot 1.15.0.dev0 documentation
参考 Renewing certificates 部分,以获得关于证书续期相关的完整说明。
在 Certbot 自动续期之后,需要重启相关服务,比如 Nginx 服务,以应用新的证书。
通过命令行:
certbot renew --deploy-hook "/path/to/deploy-hook-script"
通过配置文件:脚本保存在 /etc/letsencrypt/renewal-hooks/deploy 目录,当证书申请成功后,certbot 将执行该目录下的脚本。
执行顺序:按字母顺序排列的,并且不依赖于 Locale 域设置
certbot-dns-route53
https://snapcraft.io/install/certbot-dns-route53/ubuntu
https://certbot-dns-route53.readthedocs.io/en/stable/
snap install certbot --classic
snap set certbot trust-plugin-with-root=ok
snap install certbot-dns-route53
snap connect certbot:plugin certbot-dns-route53
mkdir -pv /etc/letsencrypt/
cat > /etc/letsencrypt/route53-credentials.ini <<EOF
[default]
aws_access_key_id=xxxxxxxxxxxxxxxx
aws_secret_access_key=xxxxxxxxxxxxxxxx
EOF
chmod 600 /etc/letsencrypt/route53-credentials.ini
export AWS_CONFIG_FILE=/etc/letsencrypt/route53-credentials.ini
certbot certonly --dns-route53 --domains "xxx,xxx,..."
certbot run
--authenticator dns-route53 \
--dns-route53-credentials /etc/letsencrypt/route53-credentials.ini
注意事项:
- 刚方式并不强制使用 DNS 质询,如果失败,则会回退到 HTTP 质询;
certbot plugins