To setup certs for two of my domains. Everything turned out perfect but when I access the domains using https://www in firefox and ie i get the SSL_ERROR_BAD_CERT_DOMAIN error.
In chrome the redirects kick in and everything works fine.
The certificate has to include the name www.domain.com and the web server has to be configured to use it.
E.g. you might use "sudo certbot --apache -d domain.com -d www.domain.com".
What does "sudo certbot certificates" display?
Chrome ignores this error.
Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is:
I ran this command:
It produced this output:
My web server is (include version):
The operating system my web server runs on is (include version):
My hosting provider, if applicable, is:
I can login to a root shell on my machine (yes or no, or I don't know):
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
I used the command “sudo certbot certificates” and got the following.
I believe when I set this up the first time, I selected option 2 for my vhosts file and the setup failed. That second key looks to be what happened when I tried again using only one domain.
I would have to disagree on the use of the word "perfectly".
Yes, it may redirect (as you instructed it), but "perfectly" will imply different things to different people...
To me it includes "best practices" - which these redirects do not.
It is considered best practice to first redirect
http to https (keeping the same FQDN)
Then to redirect
one secure name to another secure name (https://www.domain.com to just https://domain.com)
[or visa-versa, depending on your preference - some people like to see the www]
Thanks for your help. I have restarted the server and I’m seeing the same result. My end goal is to have all 4 combinations end up at https://domain.com. What is the best way to do this?
Currently I have an A name pointed at the IP of the server and a CNAME for the www as an alias of the domain. To start would that be the correct?
Thanks again for all the help. I finally got this working on the domain I asked for help with and an additional domain.
One last question @mnordhoff, In my response to your instructions to run the command sudo certbot certificates the message I got back from my server was one cert first serving the non and www domains, with a cert immediately following only serving the non www. Do I need to remove that second one and if so, what is the command for that?