79

I followed the official docs on https setup located here: https://help.ubuntu.com/6.06/ubuntu/serverguide/C/httpd.html#https-configuration

I had to remove the +CompatEnvVars from

SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire

because it said it was an invalid command or something. So having removed that and following the instructions to the nail it get the error:

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

I'm new to SSL, any advice on what's going wrong?

16 Answers 16

81

I've just experienced this issue. For me it appeared when some erroneous code was trying to redirect to HTTPS on port 80.

e.g.

https://example.com:80/some/page

by removing the port 80 from the url, the redirect works.

HTTPS by default runs over port 443.

2
  • I had a case where my <VirtualHost *:443> was written <VirtualHost *:443"> (the double quote was a typo, obviously)
    – ywarnier
    Nov 5, 2014 at 21:55
  • changing the reference to the gpgkey in my yum.repos.d/filename.repo from https to http fixed the similar issue I had
    – dmohr
    May 7, 2018 at 23:37
31

I used

a2ensite default-ssl

and it worked like a charm.

If you want to force e.g. phpmyadmin to use SSL/https you will run into this problem if this link is missing.

0
25

I had that same error. I forgot to create a link from sites-enabled/000-default-ssl to the sites-available/default-ssl file.

> ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl 
0
16

This seems to be the result you see from Firefox when the server is not configured properly for SSL. Chrome, BTW, just gave a generic "ssl failed" code.

What happens is that the browser sends a SSL handshake when the server is expecting an HTTP request. Server responds with a 400 code and an error message that is much bigger that the handshake message that the browser expects. Hence the FF message.

As we can see from the responses here there are many things that can break the SSL configuration but not stop the server starting or give any hints in error.log.

What I did was systematically check down all the answers until I finally found the right one, right at the bottom.

Here is what I had in the access logs:

rfulton.actrix.co.nz:80 192.168.1.3 - - [09/Oct/2016:13:39:32 +1300] "\x16\x03\x01" 400 0 "-" "-"
rfulton.actrix.co.nz:80 192.168.1.3 - - [09/Oct/2016:13:39:46 +1300] "\x16\x03\x01" 400 0 "-" "-"
rfulton.actrix.co.nz:80 192.168.1.3 - - [09/Oct/2016:13:49:13 +1300] "\x16\x03\x01" 400 0 "-" "-"
8

This error also occurs when you have enabled the SSL module (i.e. you have run e.g. a2enmod ssl) but not yet enabled any SSL site entries (i.e you have not run e.g. a2ensite default-ssl).

6

I got this error when I was trying to access a url using curl:

curl 'https://example.com:80/some/page'

The solution was to change https to http

curl 'http://example.com:80/some/page'
5
  • 6
    How is this a solution? You are now accessing over http rather than https! Aug 29, 2019 at 11:47
  • Lets say, it could help an api developer bypass the issue and keep working while the network team is looking into the actual issue.
    – nanospeck
    Sep 13, 2019 at 3:34
  • You can't call this a solution, that would be a workaround! And you're assuming there's other team taking care of the server... Why not assume the error and edit your answer instead of giving excuses? Sep 13, 2019 at 15:42
  • I did the same thing, changed https to http For me the reason was that the SSL was installed at the LB, and I was executing the cURL command on the server itself. So, removing the s was a solution to test my API rather than some workaround Jul 31, 2020 at 4:57
  • The solution would probably have been to use curl https://example.com/some/page without the 80 port number.
    – hlovdal
    Jan 20, 2021 at 11:59
4

In my case, I needed to install mod_ssl first

yum install mod_ssl
0
3

In my case I copied a ssl config from another machine and had the wrong IP in <VirtualHost wrong.ip.addr.here:443>. Changed IP to what it should be, restarted httpd and the site loaded over SSL as expected.

3

Finally find out the problem:
the port 443 was listening on HTTP instead of HTTPS, changed to HTTPS solved my issue.

1
  • This helped me realize I had not set the HTTP certificate paths during XCP-NG test installation. A simple config correction and update fixed it.
    – cbugk
    Sep 20 at 14:48
1

In my case I accidentally used SSL in the Virtualhost configuration for port 80, instead of 443.

1

In my case, an Ubuntu system, in ports.conf I had

NameVirtualHost *:80
NameVirtualHost 192.168.1.79
Listen 80

And then, inside , I had

NameVirtualHost *:443
Listen 443

All I had to do was remove the line NameVirtualHost 192.168.1.79. Restarted apache and problem solved.

1
  • 1
    apache2 2.4.7 says NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:xx Jun 9, 2014 at 11:10
1

My case is related to Greg B's -- Visual Studio creates two sites when SSL is enabled -- one for secure, and one for normal http requests. However Visual Studio chooses two ports at random, and depending on how you start the debugger you might be pointing towards the wrong page for the request type. Especially if you edit the URL but don't change the port number.

Seeing these posts jogged my memory.

I know this isn't APACHE related, but it is definitely a page that people with that error will find..

0

I got the same error after enabling TLSv1.2 in webmin. Right after I enabled TLSv1.2 by accident thinking it was SSLv2, I was not able to log in from https://myipaddress:10000 like I did before. I found this link http://smallbusiness.chron.com/disable-ssl-webmin-miniserv-60053.html and it helped me because I was able to access webmin config file and I was able TLSv1.2

0

If you are upgrading from an older version of apache2, make sure your apache sites-available conf files end in .conf and are enabled with a2ensite

0

Below Solution worked for me :

Type About:Config in the Address Bar and press Enter.

“This Might void your warranty!” warning will be displayed, click on I’ll be careful, I Promise button.

Type security.ssl.enable_ocsp_stapling in search box.

The value field is true, double click on it to make it false.

Now try to connect your website again.

1
  • What does this do? Could you explain your answer and why it works? Jul 18 at 3:34
0

On My side, Error if nginx.conf like

server {
listen 443;
}

curl: (35) SSL received a record that exceeded the maximum permissible length.

Solution:

server {
listen 443 ssl;
}

It's working fine after adding ssl after 443

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.