How to Fix SSL_ERROR_RX_RECORD_TOO_LONG in Apache and Nginx
Resolve port 443 plaintext HTTP responses that crash browser TLS handshakes.
SSL_ERROR_RX_RECORD_TOO_LONG occurs when a web browser expects an encrypted TLS handshake on port 443, but the server responds with unencrypted plaintext HTTP. The browser attempts to parse plaintext ASCII bytes as an SSL record length, causing the handshake to crash.
Root Cause Analysis
A missing 'ssl' directive in the server block listening on port 443, or port forwarding misconfigurations where port 443 is mapped to an unencrypted port 80 backend.
Step-by-Step Resolution Procedure
Ensure your Nginx configuration includes 'listen 443 ssl;' rather than 'listen 443;'.
In Apache VirtualHost *:443 blocks, verify that 'SSLEngine on' is explicitly configured.
Confirm that load balancers and Docker container port mappings match SSL endpoints.
Verification Command or Config Pattern
server {
# INCORRECT: listen 443; (causes SSL_ERROR_RX_RECORD_TOO_LONG)
# CORRECT:
listen 443 ssl http2;
server_name example.com;
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
}Frequently Asked Remediation Questions
Why does the browser say record too long?
Because the first bytes returned were HTTP plaintext (like 'HTTP/1.1 200 OK'). The browser attempted to read the first two bytes as an SSL record length number, which evaluates to a massive invalid number (>16384 bytes).
How do I fix this in Apache?
Inside your <VirtualHost *:443> block, ensure you have 'SSLEngine on' and valid SSLCertificateFile and SSLCertificateKeyFile paths defined.
Can an incorrect port in the URL cause this error?
Yes. Navigating to https://example.com:80 will send TLS handshake packets to an unencrypted port, immediately triggering this error.
How do I verify the fix?
Run the SSL Certificate Chain Scanner on OnChainScans to execute a direct TLS socket connection and inspect the handshake status.
Complementary Diagnostic Scanners
All 34 toolsWCAG Accessibility & Contrast Scanner
Audits foreground/background luminosity contrast ratios against WCAG 2.2 AA (4.5:1) and AAA (7:1) thresholds, detecting missing alt attributes and keyboard traps.
Robots.txt & Sitemap.xml Scanner
Verifies syntax of robots.txt files, parses nested sitemap_index.xml structures, and audits for broken URLs, conflicting directives, and 404 indexing errors.
Website Font, Color & Asset Scanner
Crawls live stylesheets to extract distinct hex color palettes, webfont load methods (WOFF2/FOUT metrics), and total uncompressed asset payload distribution.
Related Troubleshooting & RFC Playbooks
How to Fix SPF PermError: 'Too Many DNS Lookups' (RFC 7208)
Resolve the 10-lookup limit that causes receiving mail servers (Gmail, Outlook) to reject your emails.
How to Fix NET::ERR_CERT_AUTHORITY_INVALID SSL Handshake Errors
Repair broken intermediate certificate bundles and establish a trusted X.509 chain of trust.
How to Fix ERR_TOO_MANY_REDIRECTS & Circular Redirect Loops
Diagnose infinite HTTP 301/302 redirects between Cloudflare Flexible SSL, Nginx, and CMS canonical rules.