Re: Experiments with Postgres and SSL
Jacob Champion <jchampion@timescale.com>
From: Jacob Champion <jchampion@timescale.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Greg Stark <stark@mit.edu>,
Vladimir Sitnikov <sitnikov.vladimir@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2023-02-22T22:19:28Z
Lists: pgsql-hackers
On Wed, Feb 22, 2023 at 4:26 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > On 20/01/2023 03:28, Jacob Champion wrote: > > If you want to multiplex protocols on a port, now is an excellent time > > to require clients to use ALPN on implicit-TLS connections. (There are > > no clients that can currently connect via implicit TLS, so you'll > > never have another chance to force the issue without breaking > > backwards compatibility.) That should hopefully make it harder to > > ALPACA yourself or others [2]. > > Good idea. Do we want to just require the protocol to be "postgres", or > perhaps "postgres/3.0"? Need to register that with IANA, I guess. Unless you plan to make the next minor protocol version fundamentally incompatible, I don't think there's much reason to add '.0'. (And even if that does happen, 'postgres/3.1' is still distinct from 'postgres/3'. Or 'postgres' for that matter.) The Expert Review process might provide some additional guidance? > We implemented a protocol version negotiation mechanism in the libpq > protocol itself, how would this interact with it? If it's just > "postgres", then I guess we'd still negotiate the protocol version and > list of extensions after the TLS handshake. Yeah. You could choose to replace major version negotiation completely with ALPN, I suppose, but there might not be any maintenance benefit if you still have to support plaintext negotiation. Maybe there are performance implications to handling the negotiation earlier vs. later? Note that older versions of TLS will expose the ALPN in plaintext... but that may not be a factor by the time a postgres/4 shows up, and if the next protocol is incompatible then it may not be feasible to hide the differences via transport encryption anyway. > Regarding Vladimir's comments on how clients can migrate to this, I > don't have any great suggestions. To summarize, there are several options: > > - Add an "fast_tls" option that the user can enable if they know the > server supports it I like that such an option could eventually be leveraged for a postgresqls:// URI scheme (which should not fall back, ever). There would be other things we'd have to change first to make that a reality -- postgresqls://example.com?host=evil.local is problematic, for example -- but it'd be really nice to have an HTTPS equivalent. --Jacob
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Enhance libpq encryption negotiation tests with new GUC
- 705843d294d5 17.0 landed
-
With gssencmode='require', check credential cache before connecting
- 20f9b61cc192 17.0 landed
-
Add tests for libpq gssencmode and sslmode options
- 1169920ff770 17.0 landed
-
Move Kerberos module
- 9f899562d420 17.0 landed
-
Give nicer error message when connecting to a v10 server requiring SCRAM.
- 96d0f988b150 9.4.12 cited