SSL SYSCALL error: EOF detected

SQLSTATE 08006 condition connection_failure class 08 — Connection Exception severity FATAL
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 11 Jun 2026 · Reproduced live with the SQL on this page.

Symptoms

An SSL/TLS connection failed at the system-call level with an unexpected EOF — the peer closed the socket without a clean TLS shutdown. The driver reports SQLSTATE 08006 (connection_failure).

What the server log shows

ERROR:  SSL SYSCALL error: EOF detected

Why PostgreSQL raises this — what the manual says

As Section 18.9 Secure TCP/IP Connections with SSL explains:

The TLS layer hit an end-of-file at the system-call level, meaning the underlying TCP connection was closed before the SSL session ended cleanly — usually a crashed backend, a firewall reset, or an abrupt network interruption.

An EOF detected SSL SYSCALL error means the TCP socket carrying the TLS session was closed abruptly (no close-notify). The encrypted session cannot continue, so the client reports 08006.

Common causes

How to fix it

  1. Reconnect and retry; handle dropped encrypted connections gracefully.
  2. Check the server log for backend crashes/terminations.
  3. Investigate network devices and idle/keepalive settings.

Related & next steps

Reference: PostgreSQL 18 Section 19.9 “SSL”.