pgsql: Fix fallback behavior when server sends an ERROR early at startu - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix fallback behavior when server sends an ERROR early at startu
Date
Msg-id E1sXKDm-001IyB-1Y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix fallback behavior when server sends an ERROR early at startup

With sslmode=prefer, the desired behavior is to completely fail the
connection attempt, *not* fall back to a plaintext connection, if the
server responds to the SSLRequest with an error ('E') response instead
of rejecting SSL with an 'N' response. This was broken in commit
05fd30c0e7.

Reported-by: Jacob Champion
Reviewed-by: Michael Paquier
Discussion:
https://www.postgresql.org/message-id/CAOYmi%2Bnwvu21mJ4DYKUa98HdfM_KZJi7B1MhyXtnsyOO-PB6Ww%40mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f06a632a77ed27aab087d62bd76bc52be3a2ac6f

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix fallback behavior when server sends an ERROR early at startu
Next
From: Peter Eisentraut
Date:
Subject: pgsql: pg_createsubscriber: Message style improvements