首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LetsEncrypt证书更新失败

LetsEncrypt证书更新失败
EN

Server Fault用户
提问于 2016-04-02 11:38:08
回答 2查看 22.2K关注 0票数 5

我试图更新我的服务器的证书。现在的那个在一个月前就过期了,但直到现在我才把它处理好。

我试图使用letsencrypt-auto renew命令,但失败了:

注意:我更改了域/用户/服务器名称。

代码语言:javascript
复制
user@vps:~/letsencrypt# ./letsencrypt-auto renew
Updating letsencrypt and virtual environment dependencies.......
Running with virtualenv: sudo /home/user/.local/share/letsencrypt/bin/letsencrypt renew
Processing /etc/letsencrypt/renewal/www.example.com.conf
2016-04-02 07:07:00,862:WARNING:letsencrypt.cli:Attempting to renew cert from /etc/letsencrypt/renewal/www.example.com.conf produced an unexpected error: You've asked to renew/replace a seemingly valid certificate with a test certificate (domains: www.example.com, example.com). We will not do that unless you use the --break-my-certs flag!. Skipping.

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/www.example.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)

我愚蠢地用--break-my-certs标志尝试命令:

代码语言:javascript
复制
user@vps:~/letsencrypt# ./letsencrypt-auto renew --break-my-certs
Updating letsencrypt and virtual environment dependencies...You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
....
Running with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt renew --break-my-certs
Processing /etc/letsencrypt/renewal/www.example.com.conf
new certificate deployed with reload of apache server; fullchain is /etc/letsencrypt/live/www.example.com/fullchain.pem

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/www.example.com/fullchain.pem (success)

我以为是它,但当我试图连接到我的网站时,我发现一个错误,告诉我证书是由不可信的一方签发的。(不过,有效期是可以的。)

所以我再次尝试了第一个命令:

代码语言:javascript
复制
user@vps:~/letsencrypt# ./letsencrypt-auto renew
Updating letsencrypt and virtual environment dependencies.......
Running with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt renew
Processing /etc/letsencrypt/renewal/www.example.com.conf

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/www.example.com/fullchain.pem (skipped)
No renewals were attempted.

但正如你所看到的,它不起作用。

EN

回答 2

Server Fault用户

发布于 2016-04-02 17:14:36

请记住,如果您以前的证书是使用letscrypt-auto0.4.0或更高版本颁发的,那么使用letsencrypt的更新过程才能正常工作。如果您的证书是用旧的letsencrypt- after颁发的,那么您需要以与第一次相同的方式,使用相同的选项和params再次颁发证书,在此之后,that加密-自动更新将按预期的方式工作。

无论如何,您在试图更新域时收到的第一条消息是:

代码语言:javascript
复制
You've asked to renew/replace a seemingly valid certificate with a test certificate (domains: www.example.com, example.com). We will not do that unless you use the --break-my-certs flag!. Skipping.

这意味着您拥有域的有效证书,但更新命令检测到您试图使用暂存服务器而不是生产服务器来更新证书(注意:暂存服务器是letsencrypt基础结构的一部分,允许测试为您的域颁发证书的进程,但由假CA颁发,如果您检查您的证书,您可以看到颁发者是Fake LE Intermediate X1)。

因此,当您重复更新过程但使用标志--break-my-certs时,您现在拥有一个由假CA颁发的证书,连接到您站点的客户端都不会信任该证书。

我猜想您正在使用/etc/letsencrypt/cli.{conf,ini}/etc/letsencrypt/renewal/yourdomain.conf或其他用于颁发第一个证书的配置文件中的conf,并且在某些配置文件中指定了标志暂存,因此cert试图使用它来更新您的证书,而不是使用生产。

对更新的conf文件执行以下命令:

代码语言:javascript
复制
grep -E 'server\ =|config_file\ =' /etc/letsencrypt/renewal/yourdomain.conf

注意:如果您为您的域颁发了几个证书,并且从证书中包含的FQDN子集中添加或删除了域,而不是yourdomain.conf,则可以使用yourdomain-0001.confyourdomain-0002.conf等。

config_file将显示您是否正在为您的域使用配置文件,如果您不使用任何配置文件,您将看到单词None。

服务器将显示您是否在针对暂存服务器或生产服务器颁发证书。

如果它正在进行分期,您将看到以下内容:

代码语言:javascript
复制
server = https://acme-staging.api.letsencrypt.org/directory

如果是生产,你会看到:

代码语言:javascript
复制
server = https://acme-v01.api.letsencrypt.org/directory

如果您看到服务器指向暂存,请编辑域的更新配置文件,并将其更改为Producthttps://acme-v01.api.letsencrypt.org/directory

此外,如果您有一个config_file,您应该检查该配置文件,以确保服务器选项指向生产,并且没有像暂存、暂存= True、test-cert或test-cert = True这样的选项。

一旦您删除了暂存选项并将服务器更改为config_file和更新配置文件中的服务器,您可以尝试再次更新您的证书。

代码语言:javascript
复制
./letsencrypt-auto renew --force-renewal

如果您最终获得了域的证书,请注意祝贺消息,该消息将告诉您证书保存的位置,请记住这一点,以配置web服务器、邮件服务器,无论您的证书有哪些正确的路径。

代码语言:javascript
复制
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/yourdomain/fullchain.pem. Your cert
   will expire on xxxx-xx-xx. To obtain a new version of the
   certificate in the future, simply run Let's Encrypt again.
票数 8
EN

Server Fault用户

发布于 2017-06-20 17:38:14

我也遇到了同样的问题,您必须重新启动web服务器( Apache或nginx )。

我用certbot renew --quiet续订。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/767723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档