【问题标题】:Letsencrypt certbot works but renewal doesn'tLetsencrypt certbot 有效,但更新无效
【发布时间】:2017-09-05 04:11:38
【问题描述】:

我有一台服务器,它的 letsenrypt 证书已过期。为了解决这个问题,我简单地运行了certbot --apache,它运行没有问题并解决了过期的证书。

为了防止以后出现这个问题,我想让证书自动更新,所以在the instructions here之后我跑了certbot renew --dry-run,但是以错误结束:

尝试从 /etc/letsencrypt/renewal/cms.ourdomain.com.conf 更新证书产生了意外错误:授权过程失败。 cms.ourdomain.com (tls-sni-01): urn:acme:error:connection :: 服务器无法连接到客户端以验证域 :: DNS 问题:SERVFAIL 正在查找 cms.ourdomain.com 的 CAA。跳过。

由于certbot --apache 运行良好,我不知道为什么此更新会因 DNS 问题而失败。为了确保我再次运行certbot --apache 以再次强制和更新证书,这再次运行良好。因此,DNS 似乎没有任何问题。

有谁知道这个问题的原因或我该如何调试?欢迎所有提示!

【问题讨论】:

  • 听起来好像在为您的域查找(可能不存在的)CAA 记录失败。当您没有设置 CAA 记录时,似乎是带有 certbot 续订的 known problem

标签: apache ssl https dns lets-encrypt


【解决方案1】:

据我所见,certbotcertbot --apache 实际上采用了一些明显不同的代码路径。也许试试certbot --apache --dryrun

顺便说一句,我已经放弃了 Apache 的具体实现。我发现停止 apache 并运行 certbot certonly --standalone -d example.com 可以很好地生成密钥和证书(在您的 apache 配置中手动指向它们),然后 certbot renew/etc/letsencrypt/renewal-hooks/{pre|post}/apache2.sh 中使用 pre 和 post 钩子脚本来停止和启动 apache效果很好。

我的脚本如下:

#!/bin/bash

# certbot pre renewal
# stop apache

systemctl stop apache2
sleep 5s
#!/bin/bash

# certbot post renewal
# start apache

systemctl start apache2

【讨论】:

    猜你喜欢
    • 2017-07-07
    • 1970-01-01
    • 2017-02-23
    • 2018-08-05
    • 2018-09-13
    • 2012-10-03
    • 2016-10-08
    • 1970-01-01
    • 2016-11-30
    相关资源
    最近更新 更多