From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: psql: Make SSL info display more compact
Date: Mon, 28 Feb 2022 10:02:51 +0100
Message-ID: <aee28ee7-0ab3-c2e2-5bed-109feb0c089b@enterprisedb.com> (raw)
Currently, when you connect with psql over SSL, you get a display like
this:
psql (15devel)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
Since support for SSL compression has been removed from PostgreSQL, it
doesn't seem sensible to display it anymore. And while we're there, I
think the bits information is redundant, since it can be derived from
the cipher suite, either because it's part of the name (as in the
example) or by looking it up somewhere. So I propose that we make this
display a bit more compact like this:
psql (15devel)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384)
Type "help" for help.
See attached patch.
Attachments:0001-psql-Make-SSL-info-display-more-compact.patch (text/plain, 1.4K) download
From 65042b40c874ff9f3877e5bbb1915321f5759b68 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Mon, 28 Feb 2022 09:54:16 +0100
Subject: [PATCH] psql: Make SSL info display more compact
Don't display the status of SSL compression anymore, since it has been
removed from PostgreSQL. Also, remove the bits display, since that
can be derived from the cipher suite.
---
src/bin/psql/command.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.cindex 292cff5df9..20745717a8 100644--- a/src/bin/psql/command.c+++ b/src/bin/psql/command.c@@ -3667,22 +3667,16 @@ printSSLInfo(void)
{
const char *protocol;
const char *cipher;
- const char *bits;- const char *compression;
if (!PQsslInUse(pset.db))
return; /* no SSL */
protocol = PQsslAttribute(pset.db, "protocol");
cipher = PQsslAttribute(pset.db, "cipher");
- bits = PQsslAttribute(pset.db, "key_bits");- compression = PQsslAttribute(pset.db, "compression");- printf(_("SSL connection (protocol: %s, cipher: %s, bits: %s, compression: %s)\n"),+ printf(_("SSL connection (protocol: %s, cipher: %s)\n"),
protocol ? protocol : _("unknown"),
- cipher ? cipher : _("unknown"),- bits ? bits : _("unknown"),- (compression && strcmp(compression, "off") != 0) ? _("on") : _("off"));+ cipher ? cipher : _("unknown"));
}
/*
--
2.35.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com
Subject: Re: psql: Make SSL info display more compact
In-Reply-To: <aee28ee7-0ab3-c2e2-5bed-109feb0c089b@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox