Failed Certbot nginx generation VM ubuntu server

Hello i am having an issue getting a certificate, for the domain I am virtualizing the server to handle some services there. The port forwarding on potrt 80 and 443 are working well but the
comand to generate the cert always says no DNS, but there is ping to the domain where ever I try.
I have already moved the cert request to the physic server to check out if the VM is the issue but nevertheless it does not work either.

My domain is:

I ran this command:

sudo certbot certonly --webroot -d

It produced this output:

Waiting for verification...
Challenge failed for domain
http-01 challenge for
Cleaning up challenges
Some challenges have failed.

 - The following errors were reported by the server:

   Type:   connection
   Detail: Fetching
   Connection reset by peer

   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):
nginx and haproxy in the VM

The operating system my web server runs on is (include version: In a virtualized UBUNTU 20

I can login to a root shell on my machine YES

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 0.40.0

1 Like

Welcome to the community @esromerom

First, your certonly command is missing the webroot path - usually like this before the -d
-w /yourserver/root/path

Your DNS points to so you should check that is correct.

When I try connecting to your server I get the same "connection reset by peer" as shown in your error message from certbot. So, something is preventing connection.

curl -I
curl: (56) Recv failure: Connection reset by peer

Can also test connection with Lets Debug

Note right now Lets Encrypt is having some service problems but this does not cause your connection problems from Lets Debug or a curl from my test machine.


Thanks for your inmediat reply.
Well i have tried also with the webroot path parameter, But I have gotten the same answer.
Yes the DNS points to the good IP address.
And from the Lets debug site,I can see there is no answer from the port 80. I will check again but i have no clues of what could be wrong with the port forwarding.


Yeah, I do not know either. There is something wrong in your server and / or network configuration that does not allow inbound http requests. You should at least see a test page response. Note ping does not use port 80 so interesting but not a way to test that.

Maybe check your iptables? Or search for the curl error message for ideas on AskUbuntu forum. Perhaps someone else here may have other suggestions.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.