certbot-auto报错,无法更新证书解决

certbot-auto报错,无法更新证书解决

在使用Let’s Encrypt 的免费证书后,需要每三个月更新一次证书,因为免费证书的有效日期只有三个月,而certbot-auto提供了一个方法,续签证书

./certbot-auto renew --quiet

该命令将检查服务器上的证书是否将在未来30天内过期,如果是,则进行更新,后面可以加上–quiet 指令告诉 certbot 不要生成输出。
可以将其放到计划任务中,每天执行

不过目前证书有效期已经不到一个月了,但是证书并没有去更新

查看了定时任务,发现命令有被执行,但是证书并没有更新

Jan 12 03:00:01 localhost CROND[15033]: (root) CMD (/linggan/certbot-auto renew --quiet)
Jan 12 03:01:01 localhost CROND[15085]: (root) CMD (run-parts /etc/cron.hourly)
Jan 12 03:01:01 localhost run-parts(/etc/cron.hourly)[15085]: starting 0anacron

手动执行命令:

[root@localhost ~]# ./certbot-auto  renew
Upgrading certbot-auto 1.10.1 to 1.11.0...
Couldn't download https://raw.githubusercontent.com/certbot/certbot/v1.11.0/letsencrypt-auto-source/letsencrypt-auto. <urlopen error [Errno 111] Connection refused>

发现报错 Couldn’t download https://raw.githubusercontent.com

原因是:certbot-auto将始终尝试从最新版本中获取自身的最新版本

解决办法:将其版本锁定,不在获取新的更新信息就可以了
在更新命令后加–no-self-upgrade

./certbot-auto  renew --no-self-upgrade

问题解决
更新成功,可以继续白嫖三个月了

也可以在hosts文件中添加解析

[root@localhost ~]# vim /etc/hosts
199.232.4.133   raw.githubusercontent.comZZ

再次执行命令./certbot-auto renew

[root@localhost ~]# ./certbot-auto  renew
Upgrading certbot-auto 1.10.1 to 1.11.0...
Replacing certbot-auto...
Your system is not supported by certbot-auto anymore.
Certbot will no longer receive updates.
Please visit https://certbot.eff.org/ to check for other alternatives.
Saving debug log to /var/log/letsencrypt/letsencrypt.log

....


Performing the following challenges:
http-01 challenge for yxonline.art
Waiting for verification...
Cleaning up challenges


The following certs were successfully renewed:
  /etc/letsencrypt/live/域名/fullchain.pem (success)

也可以更新证书

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zhaixing_0307

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值