OnChainScans
SSL_ERROR_RX_RECORD_TOO_LONG•TLS 1.3 / RFC 8446• LIVE SCANNER EMBEDDED

How to Fix SSL_ERROR_RX_RECORD_TOO_LONG in Apache and Nginx

Resolve port 443 plaintext HTTP responses that crash browser TLS handshakes.

Live Diagnostic Tool: SSL Certificate Chain ScannerFull Tool Page
Executive Answer & Impact Analysis

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

1Check Port 443 Virtual Host Definition

Ensure your Nginx configuration includes 'listen 443 ssl;' rather than 'listen 443;'.

2Verify Apache SSLEngine Directive

In Apache VirtualHost *:443 blocks, verify that 'SSLEngine on' is explicitly configured.

3Inspect Reverse Proxy Port Mapping

Confirm that load balancers and Docker container port mappings match SSL endpoints.

Verification Command or Config Pattern

TERMINAL / CONFIGRFC TLS 1.3 / RFC 8446
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.