SMS Activate tiger-sms ChatGPT 账号/ChatGPT 代注册 OpenAI API 代充值

解决 acme.sh 更新 Let’s Encrypt 证书失败,证书过期问题

dajiaka OpenAI API key

老王今天发现一个网站的 SSL 证书居然过期了,按道理所有网站的证书都是用的 acme.sh 自动续签 Let’s Encrypt 的,不应该会出现证书过期无效的情况。于是查了下更新日志,发现在续签 SSL 证书时报了一个错:new-authz error,类型是 urn:acme:error:unauthorized,错误详情:Error creating new authz :: Validations for new domains are disabled in the V1 API,后来发现是因为那台服务器还在使用 V1 版本的 acme.sh,手动更新了下 acme.sh 就解决问题了。本文做个记录。

一、错误详情

老王的网站用的的 LNMP 一键脚本,装完后会自动新增一个 crontab 命令,用于 acme.sh 的自动续签 SSL 证书:

"/usr/local/acme.sh"/acme.sh --cron --home "/usr/local/acme.sh" > /dev/nul

查了下更新 log,无法续签 SSL 证书的错误如下:

new-authz error: {“type”:”urn:acme:error:unauthorized”,”detail”:”Error creating new authz :: Validations for new domains are disabled in the V1 API (https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430)”,”status”: 403}

看错误详情似乎是因为 V1 版本的 API 某些功能被废弃了,于是准备更新下服务器上 acme.sh 的版本。

二、acme.sh 更新方法

acme.sh 是一个非常好用的申请 SSL 证书和自动续签 SSL 证书的脚本,项目地址:https://github.com/acmesh-official/acme.sh

acme.sh 升级方法

1、官方一键升级脚本

acme.sh --upgrade

2、手动升级方法

mkdir temp && git clone https://github.com/acmesh-official/acme.sh.git temp

mv acme.sh acme.sh_backup && mv temp/acme.sh .

更新完 acme.sh 后,再去续期那个过期的 SSL 证书,成功续费 3 个月:

acme.sh 生成证书

赞(1)
关注我们
未经允许不得转载:老王博客 » 解决 acme.sh 更新 Let’s Encrypt 证书失败,证书过期问题