如何解决 certbot:错误:无法识别的参数:--dns-azure-config

how to solve certbot: error: unrecognized arguments: --dns-azure-config

提问人:kingliiis 提问时间:11/13/2023 更新时间:11/14/2023 访问量:54

问:

我想使用azure dns创建SSL证书,参考这个教程: https://medium.com/@jibinpb/lets-encrypt-certificate-with-azure-dns-b9ed32ae5aee 当我运行时出现的问题

 sudo certbot certonly --dns-azure-config ~/azure_certbot.ini -d "mydomain.com"

我收到这个错误:enter image description here

有什么建议吗?

azure dns ssl-certificate certbot-dns-plugin

评论

1赞 President James K. Polk 11/13/2023
你是否安装了适用于 Azure DNS 的 certbot 插件,如本教程中所述?
0赞 kingliiis 11/13/2023
@PresidentJamesK.Polk 是的,我遵循了 tutoriel 命令

答:

1赞 Naveen Sharma 11/14/2023 #1

此错误是由于 certbot 无法识别 --dns-azure-config,certbot 中适用于 Azure 的 DNS 插件可能未正确安装。

Error:usage: certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ... Certbot can obtain and install HTTPS/TLS/SSL certificates. By default, it will attempt to use a webserver both for obtaining and installing the certificate. certbot: error: unrecognized arguments: --dns-azure-config /home/xxxx/azure_certbot.ini

enter image description here

要解决此问题,请使用以下命令:

使用带有 DNS 质询的 certbot 手动模式进行安装,通过以下命令为您的域获取证书。sudo apt install certbot

sudo certbot --manual --preferred-challenges dns certonly -d Mydomain.com

enter image description here

此 certbot 将提示您添加 DNS TXT 记录的说明,如下所示:

Please deploy a DNS TXT record under the name
_acme-challenge.Mydomain.com with the following value:

abcdefghijklmXXXXXXXXXX

enter image description here

在 DNS 管理中,使用提供的名称 () 和 添加记录。TXT_acme-challenge.MYdomain.comvalue

等待 DNS 记录传播需要一些时间,并在添加 DNS TXT 记录后按 certbot 终端继续。enter

验证记录后,它会成功颁发证书,如下所示:

Waiting for verification... Cleaning up challenges
IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/cert.xxxxx/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/cert.xxxxprivkey.pem Your cert will expire on . To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew"
- Your account credentials have been saved in your Certbot configuration directory at /etc/letsencrypt. You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained by Certbot so making regular backups of this folder is ideal

enter image description here