Certbot 错误无属性 TLSSNI01/cert-revoke 状态代码 400

Certbot 错误无属性 TLSSNI01/cert-revoke 状态代码 400

我正在尝试使用 certbot 创建并安装 Let's Encrypt SSL 证书。它用于名为 private.mydomain.de 的子域(与 mydomain.de 位于不同的服务器上)。Certbot 中止并显示以下消息:

An unexpected error occurred:
AttributeError: 'module' object has no attribute 'TLSSNI01'

去了https://letsdebug.ne​​t/并检查了有问题的域。http
-01 和 DNS-01 测试通过,TLS-ALPN-01 失败,并显示以下详细错误消息:

IssueFromLetsEncrypt 
ERROR 
A test authorization for private.mydomain.de to the Let's Encrypt staging service 
has revealed issues that may prevent any certificate for this domain being issued.
Connection refused

DEBUG
Challenge update failures for private.mydomain.de in order  
https://acme-staging-v02.api.letsencrypt.org/acme/order/<....>/<....>
acme: error code 400 "urn:ietf:params:acme:error:connection":  
Connection refused PublicSuffix

RateLimit
DEBUG
1 Certificates contributing to rate limits for this domain
Serial: <serialnr>
NotBefore: 2020-02-02 22:23:22 +0000 UTC 
Names: [finance.mydomain.de mydomain.de] 

我现在的计划是撤销导致速率限制的证书:

用过的https://censys.io/certificates?q=...serialnr并复制 PEM,将其插入到https://tools.letsdebug.ne​​t/cert-revoke,完成 DNS 挑战并使用 dig 进行检查。“撤销证书”然后中止并显示错误:

An error occured
Unfortunately something went wrong during the process. Usually this is  
not recoverable - you will need to start from the beginning.
Error: Request failed with status code 400

再次尝试,结果相同,现在我在这里问,我该怎么办?

更新 我在 nginx.conf 中将服务器从“private.mydomain.de”重命名为“consult.mydomain.de”。此子域之前已在此服务器上使用,并且之前曾拥有证书(已通过 certbot delete --cert-name ... 卸载)。使用这个新的旧名称,Certbot 运行无问题,创建并安装了证书。

解决方案
在遇到 Certbot 的更多问题并进行更多研究后,我找到了这个解决方案:在装有 Oracle Linux 7 的 Oracle 云基础设施 (OCI) 上,不要使用 Certbox,而是安装 certbot-auto:
'''
wgethttps://dl.eff.org/certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo chown root /usr/local/bin/certbot-auto
sudo chmod 0755 /usr/local/bin/certbot-auto
sudo /usr/local/bin/certbot-auto certonly --standalone
'''
来自:https://blogs.oracle.com/developers/free-ssl-certificates-in-the-oracle-cloud-using-certbot-and-lets-encrypt

我能够创建并安装所有需要的证书。

答案1

对于非常脆弱的解决方法,您可以编辑/usr/lib/python3/dist-packages/certbot_nginx/configurator.py并替换return [challenges.HTTP01, challenges.TLSSNI01]return [challenges.HTTP01]或者您可以使用 webroot 插件)

答案2

更新到 Ubuntu 20.04 后我遇到了同样的问题。

有一个在Focal上运行的单行安装:https://github.com/vinyll/certbot-install#how-to-install

这为我解决了问题,并且当 certbot PPA 被修复时也会进行卸载。

答案3

使用 webroot 插件:

certbot certonly --webroot -w /var/www/yourdoma.in -d yourdoma.in

/var/www/yourdoma.in您的域名的 webroot 目录在哪里。

答案4

在 Ubuntu/Debian 发行版上使用旧软件包时可能会出现此错误。

检查您是否同时拥有软件包python-certbotpython3-certbot。您应该卸载较旧的软件包(python-certbot)。

ca-certificates还可以使用以下方法更新软件包apt install ca-certificates

相关内容