By rane
Hi,
I have DigitalOcean WordPress droplet. I just recently connected my NameCheap domain to my IP. Then, I used certbot --apache -d domain.com -d www.domain.com, and it said for www.domain.com it could not find a virtual host. It gave me an option of which host to choose, so I chose one and proceeded.
Now when I try to access my website, I get the “Site is not secure” error and when I click more info, it says “The hostname in the website’s security certificate differs from the website you are trying to visit. Error Code: DLG_FLAGS_SEC_CERT_CN_INVALID”
Do you know how I can fix this?
Thanks in advance!
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!
I agree – seems you haven’t generated the SSL properly.
Check out Certbot - a free, open source tool that auto installs Let’s Encrypt certs on manual admin systems like a DO droplet.
Here are some useful commands:
Know Ubuntu version: lsb_release -a
Test Nginx conf file for manual installation: sudo nginx -t
Reload Nginx before testing SSL Certificate: sudo nginx -s reload
Once the cert is properly installed, if you’re still getting a mixed content warning try this tool. Pretty handy to expose any files, especially 3rd party, that are rendering as HTTP in your source code.
Good luck!
Hi @rane,
It seems you haven’t generated your SSL for the proper domain name. I’ll recommend using Let’s Encrypt directly from it’s repo. You can check this article.
Having said that, this will only generate the certificate. If you wish to further add the vhost, I’ll suggest checking articles like THIS
Anything else than that, will be just guessing on our part.
Kind regards, Kalin
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.