【发布时间】:2017-07-24 06:55:49
【问题描述】:
我有多个具有多个证书的域:
$ ll /etc/letsencrypt/live/
> domain1.com
> domain2.com
> domain3.com
> ...
我只需要更新domain1.com,但命令certbot renew 更新所有域的证书。如何明确更新某些证书?
【问题讨论】:
标签: lets-encrypt certbot
我有多个具有多个证书的域:
$ ll /etc/letsencrypt/live/
> domain1.com
> domain2.com
> domain3.com
> ...
我只需要更新domain1.com,但命令certbot renew 更新所有域的证书。如何明确更新某些证书?
【问题讨论】:
标签: lets-encrypt certbot
使用带有--cert-name 选项的renew 续订单个证书。
(certonly为一个或多个域创建证书,如果存在则替换它)。
certbot renew --cert-name domain1.com --dry-run
删除--dry-run 以实际续订。
请注意,提供给 --cert-name 选项的值是证书名称(不是域名),使用
certbot certificates
返回一个类似的列表
-------------------------------------------------------------------------------
Found the following certs:
Certificate Name: myfundomains.com
Domains: myfundomains.com
Expiry Date: 2018-05-04 04:28:05+00:00 (VALID: 67 days)
Certificate Path: /etc/letsencrypt/live/myfundomains.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/myfundomains.com/privkey.pem
Certificate Name: ask.myfundomain.com
Domains: ask.myfundomain.com
Expiry Date: 2018-03-13 18:59:40+00:00 (VALID: 16 days)
Certificate Path: /etc/letsencrypt/live/ask.myfundomain.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/ask.myfundomain.com/privkey.pem
Certificate Name: forums.myfundomain.com
Domains: forums.myfundomain.com forum.myfundomain.com
Expiry Date: 2018-04-11 16:39:18+00:00 (VALID: 45 days)
Certificate Path: /etc/letsencrypt/live/forums.myfundomain.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/forums.myfundomain.com/privkey.pem
-------------------------------------------------------------------------------
注意第三个证书名称 (forums.myfundomain.com) 如何包含多个域:
-------------------------------------------------------------------------------
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/ask.myfundomain.com/fullchain.pem
-------------------------------------------------------------------------------
记得重新启动您的网络服务器以使用新证书。
【讨论】:
您可以使用此命令(用于 Apache 服务器):
certbot --apache certonly -n -d domain1.com
--apache 用于 apache 服务器,使用 --nginx 标志用于 nginx 服务器-n 选项在不提示的情况下执行命令-d domain1.com 仅对 domain1.com 执行您可以使用--dry-run 进行测试,您可以使用--pre-hook 和--post-hook 与certbot renew 一样
来源:https://certbot.eff.org/docs/using.html#renewing-certificates
【讨论】: