Web Server

How to fix SSL_ERROR_RX_RECORD_TOO_LONG on nginx

curl - SSL_ERROR_RX_RECORD_TOO_LONG

If curl reports “SSL_ERROR_RX_RECORD_TOO_LONG” after configuring nginx, the HTTP response protocol has been configured incorrectly.

“SSL_ERROR_RX_RECORD_TOO_LONG” means that the server returned plaintext HTTP content rather than encrypted HTTPS content.

How to fix it

  1. Check that listen is followed by ssl, as in this example.
 listen 443 ssl;
  1. If listen is configured as above and the error remains, check whether:
ssl on;

is present. If so, remove it.

EOF.← Back to articles