ERR_CERT_AUTHORITY_INVALID but SSL labs award an A+

I am using HSTS.

According to SSL Labs the site achieves an A+ grade.

However, when I try to connect using Android Chrome or Android web browser, I receive the dreaded message:

Your connection is not private 

...

NET:ERR_CERT_AUTHORITY_INVALID

Which locks me out of the site.

I am really confused!

Update:

After several ‘reload’ efforts, it started working. Is this OK, until the next time I stop and start the server after an update?

My settings are the following:

SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True

Hi @raratiru,

I’ve tested your site on Android (Chrome, Firefox, Opera and Boat Browser) and all is correct, I connect to your https site without any error or warning.

One thing that you should review is that you are serving the Let’s Encrypt intermediate certificate twice and you should only serve it once.

Righ now:

$ echo | openssl s_client -connect rara.gr:443 -servername rara.gr 2>/dev/null | awk '/Certificate chain/,/---/'
Certificate chain
 0 s:/CN=rara.gr
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
 2 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---

and it should return this result:

$ echo | openssl s_client -connect rara.gr:443 -servername rara.gr 2>/dev/null | awk '/Certificate chain/,/---/'
Certificate chain
 0 s:/CN=rara.gr
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---

Cheers,
sahsanu

4 Likes

You probably have configured both fullchain.pem and chain.pem together with your server. You should instead use cert.pem and chain.pem if your server requires the certificate chain provided separately, or else you should use only fullchain.pem by itself.

2 Likes

Thank you indeed, this is the case: The certificate is served twice.

I am not in my box now, but It is very possible I am using fullchain.pem and chain.pem together.

I remember trying to find a way that both www and non-www versions of my domain are valid and this was the combination of files that made it possible.

Apparently, this was not the most scientific and accurate approach and I have to revise it. Should I also ask my provider for some info on how it is expected to achieve that with their configuration.

As a good rule of thumb: If there are two boxes to put things in, put cert.pem in the first one and chain.pem in the second one. If there is only one box, put fullchain.pem in it.

If you were to look inside a copy of these files, you’d find that fullchain.pem is just the contents of cert.pem, followed immediately by the contents of chain.pem - it’s the same information but presented as a single file.

But, although the current configuration is not correct, and can in some rare circumstances break things, it will not matter to the vast majority of ordinary visitors to the site. So if you fear that trying to fix it will be too difficult, simply don’t worry about it.

3 Likes

Update:

I changed the configuration as follows:

Certificate: fullchain.cer

Private Key: my-site.key

Intermediates/bundle: empty

The command line still returns 2 certificates,


OK, thank you!

I updated my configuration. These are the files I used for each entry in the relevant panel of webfaction.

Certificate: my-site.cer

Private Key: my-site.key

Intermediates/bundle: ca.cer

Although it seems to be working, I still receive the following:

echo | openssl s_client -connect rara.gr:443 -servername rara.gr 2>/dev/null | awk '/Certificate chain/,/---/'
Certificate chain
 0 s:/CN=rara.gr
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
 2 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---

Hi @raratiru,

Are you sure you did the same change for rara.gr?. Because for www.rara.gr is working fine:

$ echo | openssl s_client -connect rara.gr:443 -servername www.rara.gr 2>/dev/null | awk '/Certificate chain/,/---/' 
Certificate chain
 0 s:/CN=rara.gr
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---

But as I said, rara.gr shows the extra cert:

$ echo | openssl s_client -connect rara.gr:443 -servername rara.gr 2>/dev/null | awk '/Certificate chain/,/---/'
Certificate chain
 0 s:/CN=rara.gr
   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
 2 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
---

Review the cert used by rara.gr to use the same as www.rara.gr

Cheers,
sahsanu

3 Likes

Yes I forgot to change it and I just copied the code from above. :crazy_face:

Now it works great. Thank you indeed!

3 Likes

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