pgsql: libpq: Fix error messages when server rejects SSL or GSS

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: libpq: Fix error messages when server rejects SSL or GSS
Date: 2024-04-29 15:14:26
Message-ID: E1s1Si1-000dPG-5o@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

libpq: Fix error messages when server rejects SSL or GSS

These messages were lost in commit 05fd30c0e7. Put them back.

This makes one change in the error message behavior compared to v16,
in the case that the server responds to GSSRequest with an error
instead of rejecting it with 'N'. Previously, libpq would hide the
error that the server sent, assuming that you got the error because
the server is an old pre-v12 version that doesn't understand the
GSSRequest message. A v11 server sends a "FATAL: unsupported frontend
protocol 1234.5680: server supports 2.0 to 3.0" error if you try to
connect to it with GSS. That was a reasonable assumption when the
feature was introduced, but v12 was released a long time ago and I
don't think it's the most probable cause anymore. The attached patch
changes things so that libpq prints the error message that the server
sent in that case, making the "server responds with error to
GSSRequest" case behave the same as the "server responds with error to
SSLRequest" case.

Reported-by: Peter Eisentraut
Discussion: https://www.postgresql.org/message-id/bb3b94da-afc7-438d-8940-cb946e553d9d@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/87d2801d4b247b85b70553e43b7e6db0a1e9e7cb

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

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2024-04-29 17:30:40 pgsql: Close race condition between datfrozen and relfrozen updates.
Previous Message Michael Paquier 2024-04-29 12:12:00 pgsql: Make two-phase tests of ECPG and main suite more concurrent-proo