Security & SSL

SSL_ERROR_RX_RECORD_TOO_LONG: What It Means and How to Fix It

The SSL_ERROR_RX_RECORD_TOO_LONG error means your server is sending plain HTTP traffic on port 443 instead of an encrypted TLS response, and the fix is correcting your SSL configuration.

A series of red padlocks attached to a stone wall, symbolizing security and love.

The SSL_ERROR_RX_RECORD_TOO_LONG error means your browser tried to establish an encrypted TLS connection with your server but received a plain-text HTTP response instead of a valid TLS record. In plain terms: port 443 is responding with HTTP instead of HTTPS.

This guide covers the most common causes and the exact steps to fix them in Apache, Nginx, and cPanel.

What Causes SSL_ERROR_RX_RECORD_TOO_LONG?

The root cause is almost always one of three situations:

  • VirtualHost without SSL enabled: the <VirtualHost *:443> block exists but is missing SSLEngine on, SSLCertificateFile, and SSLCertificateKeyFile directives.
  • SSL module not loaded: Apache does not have mod_ssl active — either the LoadModule ssl_module line is absent or a2enmod ssl has not been run.
  • Port 443 forwarding to HTTP: a rewrite rule or reverse-proxy configuration sends port-443 traffic to a plain-HTTP backend.

Firefox reports this as SSL_ERROR_RX_RECORD_TOO_LONG. Chrome typically shows ERR_SSL_PROTOCOL_ERROR. Both point to the same underlying issue.

Diagnose in 3 Steps

1. Check Whether Port 443 Responds with TLS

From your server terminal (or any machine with OpenSSL installed), run:

openssl s_client -connect yourdomain.com:443 -servername yourdomain.com

If you see CONNECTED followed by certificate details, TLS is working. If you see wrong version number or the response is plain HTML, the server is not encrypting on that port.

2. Test with curl

curl -Iv https://yourdomain.com

If curl returns SSL handshake failed or shows unencrypted HTML content, the problem is confirmed.

3. Check the Error Logs

Look for errors in:

  • /var/log/apache2/error.log (Debian/Ubuntu)
  • /var/log/httpd/error_log (CentOS/RHEL)
  • /var/log/nginx/error.log

Typical messages include "You're speaking plain HTTP to an SSL-enabled server port" or "Invalid method in request".

Fix in Apache

Step 1: Confirm mod_ssl Is Active

On Debian/Ubuntu-based systems:

sudo a2enmod ssl
sudo systemctl restart apache2

On CentOS/RHEL, verify your Apache configuration includes:

LoadModule ssl_module modules/mod_ssl.so

Step 2: Configure the Port-443 VirtualHost Correctly

The minimum required block for SSL in Apache:

<VirtualHost *:443>
    ServerName yourdomain.com
    DocumentRoot /var/www/yourdomain

    SSLEngine on
    SSLCertificateFile    /path/to/certificate.crt
    SSLCertificateKeyFile /path/to/private.key
    SSLCertificateChainFile /path/to/chain.crt
</VirtualHost>

Without SSLEngine on, Apache answers in plain text on port 443 and produces exactly this error.

Step 3: Validate Syntax and Restart

apachectl configtest
sudo systemctl restart apache2

Fix in Nginx

The equivalent error in Nginx occurs when the server block listening on port 443 is missing listen 443 ssl:

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate     /path/to/certificate.crt;
    ssl_certificate_key /path/to/private.key;

    root /var/www/yourdomain;
    index index.html;
}

Test and reload:

nginx -t
sudo systemctl reload nginx

Fix in cPanel / Shared Hosting

If you use cPanel, the process is simpler:

  1. Go to cPanel → SSL/TLS → Manage SSL Sites.
  2. Find your domain and verify the certificate, private key, and CA bundle are correctly installed.
  3. If SSL is not active, use AutoSSL (cPanel → SSL/TLS → Manage AutoSSL) to install a Let's Encrypt certificate automatically.
  4. For a custom certificate, use Install and Manage SSL to paste it in manually.

Hosting plans at elenlace.com include free SSL with automatic renewal, eliminating this type of configuration error entirely.

For a full reference of SSL errors and solutions, visit our SSL security section.

Less Common but Frequent Causes

Scenario Extra Symptom Fix
Firewall / reverse proxy without TLS termination Works internally, fails externally Enable TLS on the load balancer or terminate SSL at the proxy
Expired or wrong-CN certificate Different error in some browsers Renew or reinstall the correct certificate
Port 443 blocked, traffic falls through to port 80 Page loads over HTTP without a protocol error Open port 443 in the server firewall
Apache ProxyPass to an HTTP backend Error only on specific paths Review ProxyPass rules and ensure SSL termination happens before the backend

Key Takeaways

  • SSL_ERROR_RX_RECORD_TOO_LONG means port 443 is returning plain HTTP traffic instead of encrypted TLS.
  • The most common Apache cause is a port-443 VirtualHost missing SSLEngine on or mod_ssl not loaded.
  • In Nginx, the server block must have listen 443 ssl plus correct paths to the certificate and key.
  • In cPanel, AutoSSL or manual certificate installation resolves the issue in minutes.
  • Use openssl s_client to diagnose port 443 before touching any configuration files.
  • Always validate syntax (apachectl configtest / nginx -t) before restarting the web server.

Still seeing SSL_ERROR_RX_RECORD_TOO_LONG after working through all of the above? The specialists at elenlace.com can diagnose and fix your SSL configuration remotely — get in touch today.

FAQ

Why does Firefox show SSL_ERROR_RX_RECORD_TOO_LONG while Chrome shows ERR_SSL_PROTOCOL_ERROR?

These are two different messages for the same problem: the server is responding with plain text on port 443. Firefox describes the unexpected TLS record it received; Chrome labels it a generic SSL protocol error. The cause and fix are identical in both cases.

Could a bad SSL certificate itself cause this error?

Rarely. A malformed or expired certificate normally triggers a different browser error (such as NET::ERR_CERT_AUTHORITY_INVALID). SSL_ERROR_RX_RECORD_TOO_LONG almost always points to the server not encrypting the connection at all, regardless of what certificate is installed.

Will renewing the SSL certificate fix this error?

No. Renewing the certificate does not resolve this error because the problem is a server configuration issue, not a certificate issue. You must ensure SSL is enabled and correctly configured in the VirtualHost or server block.

How do I prevent this error in the future?

Use a hosting plan with automatic SSL (Let's Encrypt with auto-renewal), keep your web server updated, and if you manage Apache or Nginx manually, add an SSL connectivity check to your deployment checklist.

Useful resources

Other providers and guides worth comparing:

← All