Thursday, February 15, 2018

[SSL][Resolved] letsencrypt www not working

it's strange that the cert work on non-www but not www.
When I visit the domain with www, I got this problem :

Your connection is not private

Attackers might be trying to steal your information from www.example.com (for example, passwords, messages or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID

Help improve Safe Browsing by sending some system information and page content to Google. Privacy Policy
I would like to redirect the www to non-www but not work. Finally I found it related to my A/AAAA record settings: (these IP are fake and for examples)

Hostname     IP Address           TTL
------------------------------------------------------------------------------
                    140.164.10.171                             Default
mail            140.164.10.171                              Default
www           140.164.10.171                             Default
                    2400:8901::f04c:21ff:aee4:f001 Default
mail             2400:8901::f04c:21ff:aee4:f001 Default
www           2400:8901::f04c:21ff:aee4:f001 Default
After I removed the line in red, it works.

If still not work, try to reinstall your domain cert (with www) with certbot such as this command :
sudo certbot --nginx
Example :


What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1

No comments :

Post a Comment