Fix SSL_ERROR_RX_RECORD_TOO_LONG
SSL_ERROR_RX_RECORD_TOO_LONG is Firefox's message when it opens a secure connection and the server replies with something that is not TLS, usually plain HTTP text. Browsers read the first bytes of that reply as a record length, which comes out far too large. The error is not about the certificate itself.
SSL_ERROR_RX_RECORD_TOO_LONG: the usual causes
| Cause | Where to look |
|---|---|
| Port 443 is served without SSL enabled | Nginx listen 443 missing ssl, Apache missing SSLEngine on |
| HTTPS URL pointing at an HTTP-only port | Links like https://example.com:8080 |
| No virtual host for 443 | Requests fall back to the default HTTP site |
| Proxy or load balancer speaking HTTP on 443 | Upstream or listener protocol setting |
| SSL module not loaded or site not enabled | Apache mod_ssl, enabled sites |
SSL_ERROR_RX_RECORD_TOO_LONG: the nginx fix
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}
A listen 443; without ssl is the classic mistake. Run sudo nginx -t and reload.
Apache fix
sudo a2enmod ssl
sudo a2ensite default-ssl # or your own SSL site
sudo systemctl reload apache2
<VirtualHost *:443>
ServerName example.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
Diagnose from the command line
curl -vk https://example.com/
openssl s_client -connect example.com:443 -servername example.com
If OpenSSL shows plain-text HTTP output or "wrong version number", the port is not speaking TLS. Also check which process owns the port with sudo ss -tlnp | grep :443.
Check the other layers
- Firewall and port forwarding: make sure 443 reaches the right service, not an HTTP-only one.
- Load balancer: a listener on 443 must use an HTTPS protocol, not HTTP.
- Docker: confirm you map host port 443 to the container's TLS port.
- CDN: verify the origin mode. See Flexible vs Full vs Full (Strict).
Verify
When the config is fixed, test with the SSL Checker to confirm a valid certificate and chain, and use the HTTPS Redirect Generator to add a clean HTTP to HTTPS redirect.
Why it is hard to spot
The site often works on port 80 and the certificate looks fine in the control panel, so the setup seems correct. The mismatch is only visible when a client actually connects to 443. Always test the live port, not just the configuration files, and confirm that the virtual host you edited is the one that answers for your hostname.
Related reading: Fix SSL on Nginx Proxy Manager and Caddy, the protocol error and fixing redirect loops.
Frequently Asked Questions
Does this mean my certificate is invalid?
No. The browser never reached a TLS handshake, so the certificate is not the problem.
Why does only Firefox show this?
Other browsers show different messages, such as ERR_SSL_PROTOCOL_ERROR, for the same condition.
Can a wrong port in a URL cause it?
Yes. An https:// URL pointing to a port that serves plain HTTP triggers it.
Will reinstalling the certificate help?
Not unless the server is not using SSL on that port.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.