Your browser sent a request that this server could not understand

Hello,
I am encountering a problem. If I go to the http://mydomainname:443, I have an error message.
As if the http was not redirected to the https
Can you help me ?
Thank you

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog /var/www/html/log/http.error

</VirtualHost>

 "# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog /var/www/html/log/http.error


ServerName mydomainname.synology.me
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/mydomainname.synology.me/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomainname.synology.me/privkey.pem
</VirtualHost>
</IfModule>

You’re making a HTTP request to the HTTPS port.

Normally you would make a HTTP request to http://mydomainname.synology.me (port 80 by default) and that would be redirected to https://mydomainname.synology.me (port 443 by default).

If you make a HTTP request to port 443, the server will return an error because it’s expecting HTTPS requests on that port.

I doubt many people will accidentally add :443 to the end of your URL. But if it bothers you, you can enable HSTS which would at least fix it for anyone that has visited the correct URL in the recent past.

edit: I don’t see any redirect in your HTTP configuration for port 80 either, though, so even http://mydomainname.synology.me might not redirect until you add that.

1 Like

Okay, I had the impression that before reinstalling certbot-auto, I had a redirection.

Hello,
when I go on my raspberry locally https://192.168.1.55:443 I have an error message.

NET::ERR_CERT_COMMON_NAME_INVALID

how to rectify that?
thank you

Using not the IP but the domain name to access it should solve the issue. Let’s Encrypt certificates are issued for domains. If you need a certificate for an IP specifically, you can use a self-signed certificate, but you will need to make sure it is trusted by your browser (either by adding a permanent “exception” or by importing it).

1 Like

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