Re: [PATCH v1] Add ssl_alt_cert_file/ssl_alt_key_file for dual RSA+ECDSA certificate support

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH v1] Add ssl_alt_cert_file/ssl_alt_key_file for dual RSA+ECDSA certificate support
Date: 2026-06-12 20:39:27
Message-ID: CAN4CZFPZzFvaZm49ysA1zJAqzKaX50OqF+kZUot1gx_6LbDkkQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

The problem the patch tries to solve is real, but I see several
gaps/problems with the current implementation with some testing:

1. it seems to break TLS 1.3 HelloRetryRequest as it tries to add the
second certificate with override=0. Connection then fails with "SSL
error: tlsv1 alert internal error", server log shows "could not update
certificate chain: not replacing certificate" / "failed to switch to
SSL configuration for host, terminating connection"

2. The global ssl_alt_* GUCs are loaded into every pg_hosts context.
If the SNI cert is a different type, it loads the alternative
certificates as alternatives, if it's the same type, it replaces the
hosts entry.

3. pg_hosts/SNI has no support for the new GUCs, there's no way to
configure per host versions of the feature. Shouldn't the patch
include proper support for SNI?

4. Shouldn't alternative certificates load the entire chain, not just
the first block?

5. If both have the same type, the alternate certificate silently
replaces the primary one. Shouldn't that result in a startup error
instead?

6. Won't this cause build failure with LibreSSL, or older OpenSSL?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-06-12 20:44:25 Re: [PATCH] seg: preserve the upper boundary's certainty indicator in seg_out()
Previous Message Sami Imseih 2026-06-12 20:37:41 Re: mxid_score can become Infinity in pg_stat_autovacuum_scores