Re: Requesting feedback on hybrid key exchange in Postgres

From: Roberto Mello <roberto(dot)mello(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: jacob(dot)champion(at)enterprisedb(dot)com
Subject: Re: Requesting feedback on hybrid key exchange in Postgres
Date: 2026-12-06 02:26:43
Message-ID: CAKz==bKurMrOMUgOQCEHewVvBtgMWqfa_iwsqtARPJFq=puO3g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jacob Champion wrote:
> Are there things we can do to improve the usability?

Quick test on master (8d90516) with OpenSSL 3.5.9, self-signed P-256 cert,
using openssl s_client -starttls postgres, and psql through a TCP proxy
that parses the TLS hellos:

- default ssl_groups (X25519:prime256v1): a client offering only
X25519MLKEM768 fails the handshake (alert 40). psql's default ClientHello
offers X25519MLKEM768 and X25519 key shares, and the server picks x25519.
- ssl_groups = 'X25519MLKEM768:X25519': a client offering X25519MLKEM768
negotiates X25519MLKEM768, and so does psql. A client offering only X25519
falls back to X25519. Another client offering only prime256v1 fails the
handshake, since that list drops prime256v1 from the default. Adding it
('X25519MLKEM768:X25519:prime256v1') makes it work again. That might be
worth showing in the docs.

As far as usability I found no way to confirm the negotiated group from the
Postgres side. \conninfo, pg_stat_ssl, sslinfo and the log_connections line
show protocol, cipher and bits (sslinfo: version/cipher and cert fields),
never the group, and PQsslAttribute() has no group attribute. A group
column/attribute (pg_stat_ssl, PQsslAttribute, sslinfo) would help, which I
think fits the sslinfo work you mentioned.

Roberto

On Fri, Dec 4, 2026 at 10:52 AM Jacob Champion <
jacob(dot)champion(at)enterprisedb(dot)com> wrote:

> Hi -hackers,
>
> Recent news [1] and rumors are flying around about the general state
> of elliptic-curve cryptography. I'm not interested in fanning the
> flames of unnecessary panic, and I'm beyond disappointed in the
> vaguebooking that's going on by a bunch of people with power, but I am
> also uninterested in getting caught flat-footed.
>
> PG18 and 19 allow DBAs to set ssl_groups, which can advertise hybrid
> key exchange methods like X25519MLKEM768 as long as you have a newer
> OpenSSL. If you are already using, or just interested in, such
> schemes: are you happy with the implementation? Is it working for you?
> Are there things we can do to improve the usability?
>
> Relatedly, it would also be nice to get some subset of Dmitry Dolgov's
> sslinfo enhancements [2] into PG20.
>
> Thanks,
> --Jacob
>
> [1]
> https://arstechnica.com/security/2026/12/nsa-advises-immediate-transition-to-quantum-safe-crypto-what-you-should-know/
> [2]
> https://postgr.es/m/d57duqvzkxe43oons3jkdq7pj2wacidg7qorxommri74evu3l2%404x53she7mf77

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberto Mello 2026-12-06 02:48:12 Re: Proposal: per-table row counts in pg_dump/pg_restore, with restore-time verification
Previous Message Roberto Mello 2026-12-06 02:20:41 Re: FULL JOIN planning failure with virtual generated columns