Adding subdomain failed - HSTS enabled


I have certificate generated for
I have HSTS configured for isn’t working, because certificate doesn’t include www. submdomain for
I’m trying to expand my certificate, but I can’t. Its probably because of HSTS, client can’t connect to, because there is invalid certificate…
So… I can’t generate valid certificate for my website subdomain, because… it has invalid certificate and HSTS enabled…
What should I do?

My domain is:

I ran this command:

certbot certonly --webroot --agree-tos -w /etc/letsencrypt/ --expand -d,

It produced this output:

Failed authorization procedure. (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to


  • The following errors were reported by the server:

Type: connection
Detail: Could not connect to

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 operating system is (include version):

Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
Description: Debian GNU/Linux 8.6 (jessie)

My web server is (include version):

nginx version: nginx/1.11.6

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’m using a control panel to manage my site (no, or provide the name and version of the control panel):



Let’s Encrypt does not implement or keep track of HSTS. The first verification request for each domain is always sent on port 80 via HTTP, which then may redirect to a https URL on port 443.

This seems to be a server misconfiguration on your end for the www subdomain, it doesn’t seem to be serving anything. Compare the following two curl outputs:

$ curl -v
*   Trying
* Connected to ( port 80 (#0)
> GET /.well-known/acme-challenge/test HTTP/1.1
> Host:
> User-Agent: curl/7.43.0
> Accept: */*
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.11.6
< Date: Sat, 19 Nov 2016 10:03:00 GMT
< Content-Type: text/html
< Content-Length: 185
< Connection: keep-alive
< Location:
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
$ curl -v
*   Trying
* Connected to ( port 80 (#0)
> GET /.well-known/acme-challenge/test HTTP/1.1
> Host:
> User-Agent: curl/7.43.0
> Accept: */*
* Empty reply from server
* Connection #0 to host left intact
curl: (52) Empty reply from server


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