Cant get cert on my server


My domain is:

I ran this command:
letsencrypt certonly --webroot -w /var/www/letsencrypt -d --rsa-key-size 4096 --dry-run

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for
Using the webroot path /var/www/letsencrypt for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching Invalid host in redirect target “”. Only domain names are supported, not IP addresses


  • The following errors were reported by the server:

    Type: connection
    Detail: Fetching Invalid host in redirect
    target “”. Only domain names are supported, not IP

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A 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 1.10.3

The operating system my web server runs on is (include version):
Debian Stretch

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I have a server that’s in my home network. Ports 443 and 80 are forwarded (not right now but was when I ran the command). I’ve forwarded the domain to my IP address which is fixed. Also there is a A record with that points to the same IP address.


You have these two IP addresses:  180  A  180  AAAA  2a01:4f8:221:11cd:9734:4c26:6044:5f33

Accessed using IPv6, is an Nginx 1.6.2 web server that returns an HTTP redirect to “”. Let’s Encrypt doesn’t support IP address URLs, and it would presumably return the wrong file anyway.

HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Sun, 23 Dec 2018 14:12:52 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Sun, 23 Dec 2018 14:12:52 GMT
Last-Modified: Thu, 03 Apr 2014 07:41:03 GMT
Cache-Control: pre-check=0, post-check=0, max-age=0, no-store, no-cache, must-revalidate

Accessed over IPv4, the connection times out.

By the way, for, IPv6 returns “Connection refused” and IPv4 times out.

So IPv6 is pointing to the wrong server or you need to fix the Nginx configuration.

The fact that IPv4 times out doesn’t really affect Let’s Encrypt validation, but probably means that there’s a firewall – on your equipment or at your ISP – or the port forwarding settings aren’t working, and you’d probably want to fix it.

Edit: The IPv6 address’s reverse DNS is “”, so it’s probably a redirect service offered by your registrar? That’s not necessarily a problem, but their implementation won’t work for Let’s Encrypt validation. And do you really want users with IPv6 connections to get a redirect like that anyway?


Thank you. I have to read up on that. I am far from being an expert on DNS, IP etc stuff :frowning:
Right now you won’t be able to reach my address I think because I removed the forwards in my router.

Cant you tell me how you checked my data?


I would start with: Checking that the webroot matches the DocumentRoot in your config.

Then place a test test file in the challenge folder and ensure it can be accessed from the Internet:
mkdir {DocumentRoot}/.well-known/
mkdir {DocumentRoot}/.well-known/acme-challenge/
echo "OK" > {DocumentRoot}/.well-known/acme-challenge/1234
Should return: “OK”
[replace {DocumentRoot} with your actual DocumentRoot path]

Remove AAAA record if not using IPv6.

Check letsencrypt version (and update if needed):
letsencrypt --version

Add “WWW” to your cert request (as the “WWW” returns the same IP (set).
letsencrypt certonly --webroot -w {DocumentRoot} -d -d --rsa-key-size 4096 --dry-run

If letsencrypt fails (even after update), I would try certbot-auto:
[although it does take a while to install, I have had success on Pi3 with certbot-auto]

Also, although LE will follow redirects, it will not validate via an IP address (not even redirection to IP address). So, I would remove that method of redirection; as it would eventually fail nonetheless: would redirect to http://ip.ip.ip.ip/
Which present a cert for domain
Which would not match the URL “name” (ip.ip.ip.ip).

closed #5

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