How to Diagnose SSL_ERROR_RX_RECORD_TOO_LONG
Firefox shows SSL_ERROR_RX_RECORD_TOO_LONG when HTTPS gets a non-TLS reply, usually plain HTTP on port 443. Reproduced locally, with the bytes behind it.
SSL_ERROR_RX_RECORD_TOO_LONG is Firefox’s error when it starts a TLS (HTTPS) connection and the server answers with something that is not TLS, most often plain HTTP on the HTTPS port. Firefox tries to read the reply as a TLS record, the length field comes out impossibly large, and it reports “SSL received a record that exceeded the maximum permissible length.” The fix is on the server: serve TLS on port 443 (or whichever port the URL uses), or use http:// for a port that only speaks HTTP.
Why “too long”: the bytes
Every TLS record starts with a 5-byte header: content type (1 byte), protocol version (2 bytes) and length (2 bytes). When the client expects TLS but receives an HTTP response, the first five characters HTTP/ are read as that header:
Firefox reports the length violation; other clients notice the bad version first and phrase it differently, as our test shows.
Reproduced locally
We ran a plain HTTP server on port 9444 and connected to it with TLS clients:
$ openssl s_client -connect 127.0.0.1:9444
…:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:…
$ curl -sS https://127.0.0.1:9444/
curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
Same mistake, three different messages: OpenSSL says wrong version number, the LibreSSL build of curl on macOS reports a protocol version alert, and Firefox says record too long. Chrome typically shows ERR_SSL_PROTOCOL_ERROR for the same situation.
To see what the server actually sent, we fed it a fake TLS record with nc and dumped the reply:
$ printf '\x16\x03\x01\x00\x05hello' | nc -w1 127.0.0.1 9444 | xxd
00000000: 4854 5450 2f31 2e31 2034 3030 2042 6164 HTTP/1.1 400 Bad
00000010: 2052 6571 7565 7374 0d0a 436f 6e6e 6563 Request..Connec
00000020: 7469 6f6e 3a20 636c 6f73 650d 0a0d 0a tion: close....
A plain-text HTTP/1.1 400 Bad Request where TLS bytes should be is conclusive.
Common causes
| Cause | How to confirm | Fix |
|---|---|---|
Server block on 443 without TLS (listen 443; instead of listen 443 ssl; in nginx) | curl -v http://host:443/ returns a normal HTTP response | enable TLS on that listener and configure the certificate |
HTTPS URL pointing at an HTTP-only port (e.g. https://host:8080) | the app’s own docs or curl http://host:8080 works | use http:// for that port or put TLS in front |
| Proxy or load balancer forwarding HTTPS to an HTTP backend port, or vice versa | backend logs show TLS garbage or 400s | match the protocol between proxy and backend |
| TLS-intercepting proxy or captive portal answering in plain text | happens only on one network | log in to the portal, or check proxy settings |
Quick checks
- Test the port with plain HTTP:
curl -v http://example.com:443/. If you get an HTTP response, the server is not speaking TLS there. - Test TLS explicitly:
openssl s_client -connect example.com:443 -servername example.com. A healthy server prints its certificate chain. - Check the server config for the listener on that port, then reload and retest.
If TLS is running but client and server cannot agree on settings, the error is different; see ERR_SSL_VERSION_OR_CIPHER_MISMATCH. If the handshake works but the certificate is not trusted, see ERR_CERT_AUTHORITY_INVALID.
Sources
How we made this
Reproduced in a local lab. We started a plain-HTTP Node.js server on localhost:9444 and connected to it as if it were TLS with OpenSSL 4.1.0 s_client and with curl 8.7.1 (LibreSSL 3.3.6). We also sent a fake TLS record with nc and dumped the server's plain-text reply with xxd. Error lines and bytes are quoted verbatim. Firefox's message text is taken from NSS's SSLerrs.h.
Performed by Claude, an AI assistant working in the BinConvert repository (macOS, OpenSSL 4.1.0, curl 8.7.1 (LibreSSL 3.3.6), Node.js 25.8.2), November 16, 2026.
This article was drafted with AI assistance. Every example, calculation and command output on this page was re-run or checked before release; the mismatch was reproduced again and the byte arithmetic recomputed. Review: automated test suite and source check, November 16, 2026.
Spotted an error? Tell us and we will correct it.