pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedpsql: Make SSL info display more compact
10+ messages / 5 participants
[nested] [flat]
Commits from this thread:
2022-03-04 d816f366bc psql: Make SSL info display more compact
* psql: Make SSL info display more compact
@ 2022-02-28 09:02 Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 10+ messages in thread
From: Peter Eisentraut @ 2022-02-28 09:02 UTC (permalink / raw)
To: pgsql-hackers
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.c
index 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
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 09:21 Daniel Gustafsson <daniel@yesql.se>
parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Gustafsson @ 2022-02-28 09:21 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers
> On 28 Feb 2022, at 10:02, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
> Since support for SSL compression has been removed from PostgreSQL, it
> doesn't seem sensible to display it anymore.
This was originally done, but all client side changes reverted as there still
are server versions in production which allow compression.
--
Daniel Gustafsson https://vmware.com/
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 10:50 Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
parent: Daniel Gustafsson <daniel@yesql.se>
0 siblings, 2 replies; 10+ messages in thread
From: Dagfinn Ilmari Mannsåker @ 2022-02-28 10:50 UTC (permalink / raw)
To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 28 Feb 2022, at 10:02, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
>> Since support for SSL compression has been removed from PostgreSQL, it
>> doesn't seem sensible to display it anymore.
>
> This was originally done, but all client side changes reverted as there still
> are server versions in production which allow compression.
How about making it show "compression: on" if compression is on, but
nothing in the common "off" case?
- ilmari
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 11:21 Michael Paquier <michael@paquier.xyz>
parent: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
1 sibling, 1 reply; 10+ messages in thread
From: Michael Paquier @ 2022-02-28 11:21 UTC (permalink / raw)
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-hackers
On Mon, Feb 28, 2022 at 10:50:01AM +0000, Dagfinn Ilmari Mannsåker wrote:
> Daniel Gustafsson <daniel@yesql.se> writes:
>> On 28 Feb 2022, at 10:02, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>> This was originally done, but all client side changes reverted as there still
>> are server versions in production which allow compression.
>
> How about making it show "compression: on" if compression is on, but
> nothing in the common "off" case?
Hm, no, as it can be useful to know that compression is disabled when
connecting to an old server. What about that making the information
shown version-aware? I would choose to show the compression part only
for server versions where it is settable.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 11:56 Peter Eisentraut <peter.eisentraut@enterprisedb.com>
parent: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
1 sibling, 1 reply; 10+ messages in thread
From: Peter Eisentraut @ 2022-02-28 11:56 UTC (permalink / raw)
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Daniel Gustafsson <daniel@yesql.se>; +Cc: pgsql-hackers
On 28.02.22 11:50, Dagfinn Ilmari Mannsåker wrote:
> Daniel Gustafsson <daniel@yesql.se> writes:
>
>>> On 28 Feb 2022, at 10:02, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>>
>>> Since support for SSL compression has been removed from PostgreSQL, it
>>> doesn't seem sensible to display it anymore.
>>
>> This was originally done, but all client side changes reverted as there still
>> are server versions in production which allow compression.
>
> How about making it show "compression: on" if compression is on, but
> nothing in the common "off" case?
That would work for me.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 11:57 Peter Eisentraut <peter.eisentraut@enterprisedb.com>
parent: Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 10+ messages in thread
From: Peter Eisentraut @ 2022-02-28 11:57 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; pgsql-hackers
On 28.02.22 12:21, Michael Paquier wrote:
> What about that making the information
> shown version-aware? I would choose to show the compression part only
> for server versions where it is settable.
That might lead to confusing results if you are not connecting to
something that is a stock PostgreSQL server.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 12:48 Daniel Gustafsson <daniel@yesql.se>
parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Gustafsson @ 2022-02-28 12:48 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; pgsql-hackers
> On 28 Feb 2022, at 12:56, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
> On 28.02.22 11:50, Dagfinn Ilmari Mannsåker wrote:
>> Daniel Gustafsson <daniel@yesql.se> writes:
>>> This was originally done, but all client side changes reverted as there still
>>> are server versions in production which allow compression.
>> How about making it show "compression: on" if compression is on, but
>> nothing in the common "off" case?
>
> That would work for me.
On POLA grounds I would prefer to never to show it. If we ever get libpq
compression and want to show that, I'd prefer that we didn't end up
"compression" meaning one thing except when it means two things.
--
Daniel Gustafsson https://vmware.com/
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-02-28 15:12 Tom Lane <tgl@sss.pgh.pa.us>
parent: Daniel Gustafsson <daniel@yesql.se>
0 siblings, 1 reply; 10+ messages in thread
From: Tom Lane @ 2022-02-28 15:12 UTC (permalink / raw)
To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> On 28 Feb 2022, at 12:56, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>> On 28.02.22 11:50, Dagfinn Ilmari Mannsåker wrote:
>>> How about making it show "compression: on" if compression is on, but
>>> nothing in the common "off" case?
>> That would work for me.
> On POLA grounds I would prefer to never to show it. If we ever get libpq
> compression and want to show that, I'd prefer that we didn't end up
> "compression" meaning one thing except when it means two things.
Well, any such output would presumably be on a different line and
thus distinguishable from the SSL property; plus, it'd be impossible
for both forms to show up in the same connection.
However, how about writing "SSL compression: on" versus writing
nothing? That avoids doubt about what it means. I don't buy
Michael's argument that this is ambiguous, either.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-03-01 08:44 Peter Eisentraut <peter.eisentraut@enterprisedb.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Peter Eisentraut @ 2022-03-01 08:44 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Daniel Gustafsson <daniel@yesql.se>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; pgsql-hackers
On 28.02.22 16:12, Tom Lane wrote:
> Daniel Gustafsson <daniel@yesql.se> writes:
>> On 28 Feb 2022, at 12:56, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>>> On 28.02.22 11:50, Dagfinn Ilmari Mannsåker wrote:
>>>> How about making it show "compression: on" if compression is on, but
>>>> nothing in the common "off" case?
>
>>> That would work for me.
>
>> On POLA grounds I would prefer to never to show it. If we ever get libpq
>> compression and want to show that, I'd prefer that we didn't end up
>> "compression" meaning one thing except when it means two things.
>
> Well, any such output would presumably be on a different line and
> thus distinguishable from the SSL property; plus, it'd be impossible
> for both forms to show up in the same connection.
>
> However, how about writing "SSL compression: on" versus writing
> nothing? That avoids doubt about what it means. I don't buy
> Michael's argument that this is ambiguous, either.
I didn't mean to reopen the whole SSL compression can of worms here, I
was mistaken about the level of support left after PG14. I was merely
lightly annoyed that the psql startup display got quite long with not
very interesting information.
I propose a reduced patch that just removes the "bits" display, since
that is redundant with the "cipher" display.
Attachments:
v2-0001-psql-Make-SSL-info-display-more-compact.patch (text/plain, 1.3K) download
From 9768dc5ab9a01a60e899bfc5c9e1a51475ded183 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 1 Mar 2022 09:38:38 +0100
Subject: [PATCH v2] psql: Make SSL info display more compact
Remove the bits display, since that can be derived from the cipher
suite.
---
src/bin/psql/command.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 292cff5df9..079f4a1a76 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3667,7 +3667,6 @@ printSSLInfo(void)
{
const char *protocol;
const char *cipher;
- const char *bits;
const char *compression;
if (!PQsslInUse(pset.db))
@@ -3675,13 +3674,11 @@ printSSLInfo(void)
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, compression: %s)\n"),
protocol ? protocol : _("unknown"),
cipher ? cipher : _("unknown"),
- bits ? bits : _("unknown"),
(compression && strcmp(compression, "off") != 0) ? _("on") : _("off"));
}
base-commit: a33e17f210547226ada52d2b8af851c3553bb4fa
--
2.35.1
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: psql: Make SSL info display more compact
@ 2022-03-02 10:24 Daniel Gustafsson <daniel@yesql.se>
parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Gustafsson @ 2022-03-02 10:24 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; pgsql-hackers
> On 1 Mar 2022, at 09:44, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
> I propose a reduced patch that just removes the "bits" display, since that is
> redundant with the "cipher"
No objections from me.
--
Daniel Gustafsson https://vmware.com/
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2022-03-02 10:24 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 09:02 psql: Make SSL info display more compact Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-02-28 09:21 ` Daniel Gustafsson <daniel@yesql.se>
2022-02-28 10:50 ` Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
2022-02-28 11:21 ` Michael Paquier <michael@paquier.xyz>
2022-02-28 11:57 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-02-28 11:56 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-02-28 12:48 ` Daniel Gustafsson <daniel@yesql.se>
2022-02-28 15:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-03-01 08:44 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-03-02 10:24 ` Daniel Gustafsson <daniel@yesql.se>
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