LNMP手动续期Let’sEncrypt SSL证书

文章2021-01-091,436 人已阅来源:网络

acme.sh更新

以前SSL证书都是自动更新的,最近发现证书到期以后居然没有更新了。

于是手动更新证书得到提示“It seems the CA server is busy now ”的相关提示。

[Thu May 28 12:01:26 CST 2020] Getting domain auth token for each domain
[Thu May 28 12:01:27 CST 2020] It seems the CA server is busy now, let’s wait and retry. Sleeping 1 seconds.
[Thu May 28 12:02:35 CST 2020] It seems the CA server is busy now, let’s wait and retry. Sleeping 1 seconds.

按理说Let's Encrypt每天签发那么多证书,不至于会这样,于是上网搜了下,出现这个结果的原因Let's Encrypt升级 API CDN 接口了。现在LNMP使用的是acme.sh 程序来进行获取证书了,acme.sh也已经更新的相关的程序。于是把程序升级下就可以了。

进入到acme文件夹,然后直接升级就可以了。

cd /usr/local/acme.sh
acme.sh --upgrade

升级完成以后,再更新证书就可以了。

另外,目前由于 acme 协议和频繁更新, 因此 acme.sh 也需要经常更新以保持同步,如果不想每次都手动升级,可以打开自动升级。

acme.sh --upgrade --auto-upgrade

以下命令为关闭自动升级。

acme.sh --upgrade --auto-upgrade 0

手动续期Let'sEncrypt SSL证书

指定域名续期,默认会根据有效期跳过,可参过参数强制执行

acme.sh --renew -d badcatxt.com

多个站点的话可一次性检查

acme.sh --cron

设置定时任务

crontab -e

0 3 * * * "/usr/local/acme.sh"/acme.sh --cron --home "/usr/local/acme.sh" > /dev/null

强制更新

acme.sh --cron --force