I tried searching for a solution and ran through some of the stuff I thought might help but its not. I ran certbot prior to having my virtual hosts set up correctly. I am currenty using Centos 7 and Certbot to create my ssl certificates. The domain is happyhandsprep.com. When I attempt to go to www.happyhandsprep.com I get the server mismatch
IE
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
Firefox www.happyhandsprep.com uses an invalid security certificate. The certificate is only valid for happyhandsprep.com Error code: SSL_ERROR_BAD_CERT_DOMAIN
I’m not certain what “sudo certbot --apache certonly” does, to be honest. It may issue a certificate, and then not configure the web server to use it. Could you show us its output?
I really appreciate the replies. It guided me to the place where I had to be to fix the issue.
Essentially I went into the config that is pointed to by the
SSLCertificateFile which I found using grep -i -r “SSLCertificateFile” /etc/httpd/ and edited the virtual host there. I was unaware it was using that rather than my main httpd.conf file.
Once i updated it to use the latest certificate that had both URLs i am no longer throwing that security error.
Thanks a million for the help and this has been a huge learning experience in apache/centos7 and SSL certs
Agreed with @rg305 and @mnordhoff that certbot --apache certonly is not necessarily desirable. It will indeed obtain a certificate and not attempt to install it, which not very many Apache users have a reason to prefer.
certonly has various uses but is often meant for use with plugins like --webroot that don’t provide an installer functionality at all. --apache isn’t in this category.