Skip to content
Latchkey

curl "(56) OpenSSL SSL_read: error" in CI

curl exit 56 with an OpenSSL SSL_read error means the TLS session broke while curl was reading response data. The handshake had already completed, so this is the encrypted connection being reset by the peer or an intermediary during the transfer.

What this error means

curl fails with "OpenSSL SSL_read: Connection reset by peer, errno 104" or "OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading" (exit 56).

Terminal
curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104

Common causes

A proxy or peer reset the TLS connection mid-read

A middlebox with a duration or size limit, or a server dropping under load, tears down the encrypted session while curl is still reading.

An abrupt close without a clean TLS shutdown

An "unexpected eof while reading" means the peer closed the socket without a proper TLS close, often a proxy or server issue.

How to fix it

Retry the transfer

SSL_read resets mid-transfer are usually transient; retry so a clean connection can complete.

Terminal
curl --retry 3 --retry-all-errors -fSL "$URL" -o out.bin

Check for a middlebox cutting the connection

If it recurs for one host, inspect proxy or firewall limits that may reset long or large TLS transfers to that destination.

How to prevent it

  • Add retries around large TLS downloads so a mid-read reset self-heals.
  • Keep transfers within any proxy duration or size limits.
  • Cache large artifacts so a reset does not force a full refetch.

Frequently asked questions

What causes ""(56) OpenSSL SSL_read""?
A middlebox with a duration or size limit, or a server dropping under load, tears down the encrypted session while curl is still reading.
How do I fix "(56) OpenSSL SSL_read"?
SSL_read resets mid-transfer are usually transient; retry so a clean connection can complete.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card