certbot无法验证域和连接被拒绝

时间:2019-09-21 22:04:56

标签: lets-encrypt certbot

我正在尝试为我的域生成证书。我可以ping我的域,但仍然出现错误。我已将入站防火墙规则添加到我的数字海洋服务器中,以接受ipv4和ipv6上的端口80。不知道出什么问题了。 [注意:我的nginx服务器未运行,因为我无法获得证书]

https://community.letsencrypt.org/t/invalid-response-404-nginx-docker-container/102525

我的域名是:www.1040nra.com

我运行了以下命令:sudo certbot certonly --staging --webroot -w / root / dt-app-data / -d 1040nra.com -d www.1040nra.com

它产生了以下输出:

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for 1040nra.com
http-01 challenge for www.1040nra.com
Using the webroot path /root/dt-app-data for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. 1040nra.com (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://1040nra.com/.well-known/acme-challenge/22AD-KFmF62z373CPiUKzk6dlr-0s5wMOmnmrziMqd4: Connection refused, www.1040nra.com (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://www.1040nra.com/.well-known/acme-challenge/ba-jjDhBUZJ9fHLofGfDYSVV5a-ETlX26A64A-2Yu0s: Connection refused

IMPORTANT NOTES:

The following errors were reported by the server:

Domain: 1040nra.com
Type: connection
Detail: Fetching
http://1040nra.com/.well-known/acme-challenge/22AD-KFmF62z373CPiUKzk6dlr-0s5wMOmnmrziMqd4:
Connection refused

Domain: www.1040nra.com
Type: connection
Detail: Fetching
http://www.1040nra.com/.well-known/acme-challenge/ba-jjDhBUZJ9fHLofGfDYSVV5a-ETlX26A64A-2Yu0s:
Connection refused

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you’re using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
My web server is (include version):

我的Web服务器运行的操作系统是(包括版本):ubuntu 18.04

3 个答案:

答案 0 :(得分:1)

您似乎已经解决了自己的问题。

这是因为certbot域无法验证DNS A记录。

确保您的域名地址指向服务器的IP地址。

如果您“最近”更改了dns,则可能需要一些时间才能删除旧的IP地址。

https://www.whatsmydns.net/

选中此处,应该只有一个IP地址,这应该是您服务器的IP地址。

答案 1 :(得分:0)

在执行以下命令

后,确保允许80443端口
sudo ufw status

如果不允许443,则运行以下命令以允许443端口:

sudo ufw allow https

答案 2 :(得分:0)

问题:问题是您的域可能未指向您的云主机 IP 和 DNS 设置

解决方案:

  1. 您必须映射您的域和 IP 网络内选项标签A
  2. 完成映射后,您必须在购买域网站的位置设置 DNS。
  3. 然后通过在此网站上输入您的域名进行检查 www.whatsmydns.net 是否显示您的 IP 地址
  4. 如果是,则您创建证书