SSL Certificate Name Mismatch CentOS 6.8

I am using CentOs 6.8 and have created a certificate for my website with certbot.

Certificate Name: sample.com
Domains: sample.com www.sample.com
Certificate Path: /etc/letsencrypt/live/sample.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/sample.com/privkey.pem

I set up the file /etc/httpd/conf.d/ssl.conf file:
ServerName: www.sample.com
ServerCertificateFile: /etc/letsencrypt/live/sample.com/fullchain.pem
ServerCertificateKeyFile: /etc/letsencrypt/live/sample.com/privkey.pem
SSLCertificateChainFile: /etc/letsencrypt/live/sample.com/chain.pem

When I now go to my site like this: https://sample.com or https://www.sample.com
I still get a crossed out https (in chrome) and it tells me that this site isn’t secure.
I tried a ssl certificate checker with www.sample.com and sample.com and it tells me that:
Certificate name mismatch
Try these other domain names (extracted from the certificates):localhost

Anyone know how to fix this?
Thanks in advance :slight_smile:

Your real domain names would allow us to help you better (assuming sample.com isn’t your real domain).

My guess is that you include http content in your pages. Try using https://www.whynopadlock.com/ to test them.

My real domain name is murphygames.com

Thanks. You are using a self signed cert.

Have you restarted your webserver (nginx) since you edited your config ?

Also, the lines you have in the first post about the config look like apache config files, yet your webserver looks to be nginx … what is your setup ?

My server is running nginx, but i edited the httpd/conf.d/ssl.conf file. I assume that is wrong.
Should I try installing the ssl certificate with nginx?

Yes, httpd/conf.d/ssl.conf is an apache file usually not nginx.

If running nginx, then you need to modify the nginx config - https://mozilla.github.io/server-side-tls/ssl-config-generator/ can be useful in creating a suitable config.

1 Like

I have opened /etc/nginx/conf.d/ssl.conf file but it was empty. I don’t think that’s normal.
Do you think I could just copy the text from a config file on the internet, or is there another way to fix it?

Edit:
I also have a file in my config folder called “wordpress_https.conf”. It also asks me for a certificate and key, like a normal config file, maybe try that one? Reinstalling nginx, with “sudo yum reinstall nginx”, doesn’t give me the default ssl config file.

Edit2:
I now have ssl on “murphygames.com” and “www.murphygames.com”. But when I now connect to my website I get a “Welcome to Nginx”-message. (On mobile only on www.murphygames.com, on murphygames.com I get an error message).
Any idea how to get my wordpress site back?

Now I have a 403 Forbidden Error. Time for a new Question.

Thanks for all the help, probably still wouldn’t know im running nginx without your help :slight_smile:

1 Like

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