By eespana
I am getting Getting NET::ERR_CERT_COMMON_NAME_INVALID on DigitalOcean Droplet using Ghost CMS when I enter my www domain in the browser.
Hopefully, this helps some else who runs into this NET::ERR_CERT_COMMON_NAME_INVALID error as DigitalOcean support only pointed me to community links with similar issues that were not helpful, since I am using a self-hosted droplet.
CAUSE:
My issue was caused during the 1-Click Ghost setup when I was entering the domain name to point to the droplet. I accidentally added an A record for both the domain and www domain pointing to the IP address. I should have added a CNAME for the www domain pointing to the @ domain name.
This caused the cert to be issued to the domain name, but it did not include the www domain in the setup.
SOLUTION:
To correct this I had to update the sites-available/mydomain.com-ssl.conf file to include the www domain.
- sudo nano /etc/nginx/sites-available/mydomain.com-ssl.conf
in the server_name line, I only had the mydomain.com
server_name mydomain.com;
to fix I had to add www.mydomain.com to the line. So the line now looks like this now
server_name mydomain.com www.mydomain.com;
Once I corrected it, I double-checked the same line had automatically updated in the /etc/nginx/sites-enabled/mydomain.com-ssl.conf file. (If it had not I would have done the same as above.)
Once that was completed I renewed the cert and reinstalled it following these instructions.
NOTE: If you try to renew the cert without fixing the *-ssl.conf file you may get an error say “could not find domain in the server block”.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Happy to hear that you’ve got it all working and thank you for sharing the solution with the community!
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.