Open CP-Tadeo opened 1 month ago
You need to have the SSL directives inside of the VirtualHost, for:
<VirtualHost *:443>
ServerName example.com
You have them under:
<VirtualHost _default_:443>
The ServerName
should be your actual hostname you access the site as and should match the hostname the certificates are created for.
What a coincidence, minutes before I read your comment I just changed the directives to be under *:443, and now its working! Thank you!
Not sure why the guide from AWS had me set it to under default:443 though. Would there be conflicts if the directives are in both?
In the AWS docs they probably presume you will not create you own VirtualHost. When you don't it will use the default virtual host as a fallback. Since you did create a VirtualHost with your ServerName though, it would take priority over the default.
So by having in both, if someone accesses your site with hostname other than that defined for ServerName in your virtual host, the default will handle it, since since the certificates aren't going to match whatever host may have been used, would get rejected by browser as not matching. So best not to set up default SSL virtual host and rely on your own one where you set proper ServerName.
Note that default isn't actually that marked as _default_
. That is just a convention that is named that. The one which it falls back onto it actually whatever VirtualHost was found first when reading configuration. Usually _default_
would be set up to be read first and thus why is used.
Recently configured Apache to read the issued SSL/TLS certificate, but when I tested the https site it returns the insecure connection and invalid response.
Below is my virtual host configuration in httpd/conf.d/
Note: ServerName not officially issued name in TLS certificate.
Below is also my ssl.conf, which directs apache to the ssl certs:
For reference, I was following this: https://docs.aws.amazon.com/linux/al2/ug/SSL-on-amazon-linux-2.html When configuring it.
I used the SSL checker https://www.sslshopper.com/ssl-checker.html
and it says that:: No SSL certificates were found on [site]. Make sure that the name resolves to the correct server and that the SSL port (default is 443) is open on your server's firewall. The SSL port 443 is open and listening.
What am I missing?