# Adding subdomain failed - HSTS enabled

**URL:** <https://community.letsencrypt.org/t/adding-subdomain-failed-hsts-enabled/22851>\
**Category:** Help\
**Created:** [November 19, 2016, 9:57am UTC](https://community.letsencrypt.org/t/adding-subdomain-failed-hsts-enabled/22851 "2016-11-19T09:57:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![N0zz](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@N0zz](https://community.letsencrypt.org/u/N0zz)\
**Post date:** [November 19, 2016, 9:57am UTC](https://community.letsencrypt.org/t/adding-subdomain-failed-hsts-enabled/22851/1 "2016-11-19T09:57:55Z")

</div>

I have certificate generated for skyots.pl  
I have HSTS configured for skyots.pl  
www.skyots.pl isn't working, because certificate doesn't include www. submdomain for skyots.pl  
I'm trying to expand my certificate, but I can't. Its probably because of HSTS, client can't connect to www.skytos.pl, 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:

> skyots.pl

I ran this command:

> certbot certonly --webroot --agree-tos -w /etc/letsencrypt/ --expand -d skyots.pl,www.skyots.pl

It produced this output:

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

> IMPORTANT NOTES:
> 
> - The following errors were reported by the server:

> Domain: www.skyots.pl  
> Type: connection  
> Detail: Could not connect to www.skyots.pl

> 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 skyots.pl 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:

> ovh

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

> yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

> no

---

<div class="post-metadata">

**Author:** ![pfg](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/pfg/32/1924_2.png) [@pfg](https://community.letsencrypt.org/u/pfg)\
**Post date:** [November 19, 2016, 10:06am UTC](https://community.letsencrypt.org/t/adding-subdomain-failed-hsts-enabled/22851/2 "2016-11-19T10:06:16Z")

</div>

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:

```auto
$ curl -v http://skyots.pl/.well-known/acme-challenge/test
* Trying 164.132.106.38...
* Connected to skyots.pl (164.132.106.38) port 80 (#0)
> GET /.well-known/acme-challenge/test HTTP/1.1
> Host: skyots.pl
> 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: https://skyots.pl/.well-known/acme-challenge/test
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.11.6</center>
</body>
</html>

```

```auto
$ curl -v http://www.skyots.pl/.well-known/acme-challenge/test
* Trying 164.132.106.38...
* Connected to www.skyots.pl (164.132.106.38) port 80 (#0)
> GET /.well-known/acme-challenge/test HTTP/1.1
> Host: www.skyots.pl
> User-Agent: curl/7.43.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host www.skyots.pl left intact
curl: (52) Empty reply from server

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [December 19, 2016, 10:06am UTC](https://community.letsencrypt.org/t/adding-subdomain-failed-hsts-enabled/22851/3 "2016-12-19T10:06:20Z")

</div>

Closed on December 19, 2016, 10:06am UTC

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