问题说明
使用certbot的renew命令续签之前申请的通配符域名时遇到了一个报错,本文记录该问题的解决方法。
使用的命令如下,由于certbot判定我的这个证书还没有接近到期,所以使用--force-renew参数来强制续签证书。
certbot renew --force-renew
执行命令后,报错提示如下:
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',). Skipping.
可以看到,问题的原因是:An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
也就是需要使用--manual-auth-hook参数来指定一个脚本来续签证书。
问题原因
出现这个问题的原因是,第一次申请证书的时候使用的是DNS验证方式,而续签时需要使用脚本来更新DNS记录,如果你想使用脚本来更新的话,可以从github中搜寻相关自动DNS验证脚本,本文将使用另一种方式解决。
问题解决
可以使用standalone命令来解决续签问题,使用该方法的前提是,本机的certbot目录中已存在之前申请过的证书相关资料
在CMD或终端执行如下命令(需管理员身份):
certbot certonly --standalone
上述命令执行完成后,certbot会询问你要申请的域名,需要申请泛域名(通配符域名)的话,需要填写根域名以及通配符域名,如:,*.。使用英文逗号分隔。
如果该域名的证书未到期,他会检测并告知你本机历史申请过的证书列表,并询问你保持当前证书状态还是续签证书,选择renew那一项即可。
选择完成后直接就提示续签成功了,同时certbot会在终端输出你证书的存放目录。
其他问题
其他的报错信息的解决方案:
其他报错1:
Failed to renew certificate with error: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /directory (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
问题原因及解决方法:显示无法连接到acme验证服务器,确认你的网络是否正常,如果开启了代理,需要关闭代理之后再执行相关Certbot命令。
其他报错2:
Error, certbot must be run on a shell with administrative rights.
问题原因及解决方法:Certbot需要使用管理员身份运行。
注:本文中所有命令均需要使用管理员身份运行。