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. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
It produced this output:--2021-07-11 18:09:17-- http://gencyberbook.com/ Resolving gencyberbook.com (gencyberbook.com)... 3.101.9.7 Connecting to gencyberbook.com (gencyberbook.com)|3.101.9.7|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://gencyberbook.com/ [following] --2021-07-11 18:09:17-- https://gencyberbook.com/ Connecting to gencyberbook.com (gencyberbook.com)|3.101.9.7|:443... connected. OpenSSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number Unable to establish SSL connection.
My web server is (include version): Apache/2.4.41
The operating system my web server runs on is (include version): Ubuntu 20.04
My hosting provider, if applicable, is: AWS EC2
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.40.0
Hi, I made a previous post on troubleshooting certbot and was pleasantly surprised with the results. However, I am running into another problem with connecting to the website itself. The website is returning a ERR_SSL_PROTOCOL_ERROR everytime I try on Chrome, and is also returning the error mentioned above when running curl or wget. I have tried checking sslLabs and https://check-your-website.server-daten.de/?q=gencyberbook.com to find more details about the error, but not too sure where to look.
Does anyone know what to do with this error? Please help!
Your site is answering with HTTP on port 443, which is bad. It should talk HTTPS on port 443 and HTTP on port 80. This is due to a misconfiguration in your Apache configuration.
@Osiris Thank you for reading my issue! I checked my VirtualHosts and they seem to point in the right direction? The port 80 VirtualHost has a redirect to port 443 VirtualHost. Here are both my VirtualHost files
As you can see, default-ssl.conf also has a port 443 virtualhost for gencyberbook.com enabled. Might be the source of the issue.
That said, that doesn't explain why this issue also exists for www.gencyberbook.com, which is not enabled in the port 443 virtualhost in default-ssl.conf?
Anyway, you seem to have disabled the default virtualhost in 000-default.conf by changing the ServerName to "dummyname.com". I would recommend not using such names which might exist, but choose something like "localhost" or "example.com". And try that for default-ssl.conf too.
Changed ServerName to localhost in 000-default.conf. Also checked to see default-ssl.conf. but had no "ServerName" anywhere. Still not working so far. apachectl -S does not also have any difference either besides the localhost
VirtualHost configuration:
*:443 is a NameVirtualHost
default server gencyberbook.com (/etc/apache2/sites-enabled/default-ssl.conf:2)
port 443 namevhost gencyberbook.com (/etc/apache2/sites-enabled/default-ssl.conf:2)
port 443 namevhost gencyberbook.com (/etc/apache2/sites-enabled/ossn-le-ssl.conf:2)
alias www.gencyberbook.com
*:80 is a NameVirtualHost
default server localhost (/etc/apache2/sites-enabled/000-default.conf:2)
port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default.conf:2)
port 80 namevhost gencyberbook.com (/etc/apache2/sites-enabled/ossn.conf:1)
alias www.gencyberbook.com
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
Without a ServerName, Apache will use the actual hostname of the server. Please add a ServerName directive (such as localhost or example.com too) and try again.
I don't know how I would be able to change the port forwarding as I am quite new to all this. Is there a way to manually change it on my machine? Thank you @Osiris and @rg305 for helping me out!
Thank you both for the help, but I have found the overall problem with my configuration. I did not know that I had to set up the default-ssl.conf and the 000-default.conf as well, adding a DocumentRoot to them. The site and SSL work perfectly fine now! Again, thank you for taking the time to help me out!
I think it's because my website setup does use the default configs for the index page. I have not entirely set up the OSSN part as the default page for the website, hence breaking each time the virtualhost was disabled. This is my first time making a website backend-wise and I can already tell there are some improvements I can make. Thank you again for the help and have a good one!