let’s encrypt 使用 certbot 强制更新指定的证书

作者

certbot 强制更新证书只用加上 --force-renewal 参数, 执行命令 certbot renew --force-renewal即可。如果是想更新指定的证书使用参数--cert-name

比如更新证书

查看当前的证书 certbot certificates 可以看到证书的名字

certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: liuhaolin.com
    Domains: liuhaolin.com www.liuhaolin.com
    Expiry Date: 2019-04-03 23:25:43+00:00 (VALID: 74 days)
    Certificate Path: /etc/letsencrypt/live/liuhaolin.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/liuhaolin.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

let's encrypt 强制更新证书

certbot  renew   --cert-name liuhaolin.com --force-renewal


 certbot  renew   --cert-name liuhaolin.com --force-renewal
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/liuhaolin.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for liuhaolin.com
http-01 challenge for www.liuhaolin.com
Waiting for verification...
Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/liuhaolin.com/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

查看更新的证书

 certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: liuhaolin.com
    Domains: liuhaolin.com www.liuhaolin.com
    Expiry Date: 2019-04-19 11:43:26+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/liuhaolin.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/liuhaolin.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

可以看到证书还可以使用 89天

回复

您的电子邮箱地址不会被公开。