aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-28 22:39:35 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-28 22:39:35 +0300
commit5c9f35fc48ea99e59300a267e090e3eafd1b3b0e (patch)
tree39699d59162ce0d368212a791e0f5b406f1865af /src
parent42b041243c00fb20023c983357e7f1ffd3710fff (diff)
downloadpostgresql-5c9f35fc48ea99e59300a267e090e3eafd1b3b0e.tar.gz
postgresql-5c9f35fc48ea99e59300a267e090e3eafd1b3b0e.zip
Fix documentation and comments on what happens after GSS rejection
The paragraph in the docs and the comment applied to sslnegotiaton=direct, but not sslnegotiation=requiredirect. In 'requiredirect' mode, negotiated SSL is never used. Move the paragraph in the docs under the description of 'direct' mode, and rephrase it. Also the comment's reference to reusing a plaintext connection was bogus. Authentication failure in plaintext mode only happens after sending the startup packet, so the connection cannot be reused. Reported-by: Jacob Champion Discussion: https://www.postgresql.org/message-id/CAOYmi+=sj+1uydS0NR4nYzw-LRWp3Q-s5speBug5UCLSPMbvGA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-connect.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index ec20e3f3a90..5c6f0d9943a 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -4430,11 +4430,12 @@ select_next_encryption_method(PGconn *conn, bool have_valid_connection)
/*
* If enabled, try direct SSL. Unless we have a valid TCP connection that
- * failed negotiating GSSAPI encryption or a plaintext connection in case
- * of sslmode='allow'; in that case we prefer to reuse the connection with
- * negotiated SSL, instead of reconnecting to do direct SSL. The point of
- * direct SSL is to avoid the roundtrip from the negotiation, but
- * reconnecting would also incur a roundtrip.
+ * failed negotiating GSSAPI encryption; in that case we prefer to reuse
+ * the connection with negotiated SSL, instead of reconnecting to do
+ * direct SSL. The point of sslnegotiation=direct is to avoid the
+ * roundtrip from the negotiation, but reconnecting would also incur a
+ * roundtrip. (In sslnegotiation=requiredirect mode, negotiated SSL is not
+ * in the list of allowed methods and we will reconnect.)
*/
if (have_valid_connection)
SELECT_NEXT_METHOD(ENC_NEGOTIATED_SSL);