diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-04-08 02:49:37 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-04-08 02:49:37 +0300 |
commit | 705843d294d5d3bc5cce4001596df4df5f1c8b59 (patch) | |
tree | 383337ffbcc0346ee4a084c611d65e8930ceeb8f /src/backend/utils/misc/guc_tables.c | |
parent | 20f9b61cc1926775b1ceb25196df942efaf8bdd2 (diff) | |
download | postgresql-705843d294d5d3bc5cce4001596df4df5f1c8b59.tar.gz postgresql-705843d294d5d3bc5cce4001596df4df5f1c8b59.zip |
Enhance libpq encryption negotiation tests with new GUC
The new "log_connection_negotiation" server option causes the server
to print messages to the log when it receives a SSLRequest or
GSSENCRequest packet from the client. Together with "log_connections",
it gives a trace of how a connection and encryption is
negotiatated. Use the option in the libpq_encryption test, to verify
in more detail how libpq negotiates encryption with different
gssencmode and sslmode options.
This revealed a couple of cases where libpq retries encryption or
authentication, when it should already know that it cannot succeed. I
marked them with XXX comments in the test tables. They only happen
when the connection was going to fail anyway, and only with rare
combinations of options, so they're not serious.
Discussion: https://www.postgresql.org/message-id/CAEze2Wja8VUoZygCepwUeiCrWa4jP316k0mvJrOW4PFmWP0Tcw@mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/guc_tables.c')
-rw-r--r-- | src/backend/utils/misc/guc_tables.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index f9bb2b0f9e5..83e3a59d7e9 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -96,6 +96,7 @@ /* XXX these should appear in other modules' header files */ extern bool Log_disconnections; +extern bool Trace_connection_negotiation; extern int CommitDelay; extern int CommitSiblings; extern char *default_tablespace; @@ -1225,6 +1226,16 @@ struct config_bool ConfigureNamesBool[] = NULL, NULL, NULL }, { + {"trace_connection_negotiation", PGC_POSTMASTER, DEVELOPER_OPTIONS, + gettext_noop("Log details of pre-authentication connection handshake."), + NULL, + GUC_NOT_IN_SAMPLE + }, + &Trace_connection_negotiation, + false, + NULL, NULL, NULL + }, + { {"log_disconnections", PGC_SU_BACKEND, LOGGING_WHAT, gettext_noop("Logs end of a session, including duration."), NULL |