Re: Proposal: Supporting URI SAN in Certificate Authentication

From: Florin Irion <irionr(at)gmail(dot)com>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: olivier cano <kindermoumoute(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, david(at)pgbackrest(dot)org, gabriele(dot)bartolini(at)enterprisedb(dot)com
Subject: Re: Proposal: Supporting URI SAN in Certificate Authentication
Date: 2026-09-17 10:10:13
Message-ID: a3335e80-c032-493b-83f6-de1d658e6489@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Here is the first version of the patch to support URI SAN in certificate
authentication (clientname=URI in pg_hba.conf). We can start a discussion
on the actual code now.The patch can also be reviewed on my “postgres”
project fork [1].

Together with Leonardo Cecchi, CloudNativePG (CNPG) maintainer, we also
tested the patch using the cnpg-i-spiffe plugin[2] that he wrote for the
occasion and the generated container image for CloudNativePG [3]. Everything
worked smoothly, and workloads can now authenticate natively with SPIFFE
IDs.

Given that both CloudNativePG and SPIFFE/SPIRE are CNCF projects, we
contacted
Agustín Martínez Fayó, a SPIRE maintainer, to verify the integration between
the two projects and to begin collaborating on the topic. We decided to
strictly allow only a single URI SAN per certificate. This follows the
X509-SVID spec, avoiding weird edge cases with user mapping, and making
connection logging very clear.

Cheers,
Florin

[1] - https://github.com/irionr/postgres/pull/7

[2] - https://github.com/leonardoce/cnpg-i-spiffe

[3] -
https://github.com/leonardoce/postgres-trunk-containers/actions/runs/35070429177

Attachment Content-Type Size
v1-0001-libpq-Support-URI-SANs-in-certificate-authenticat.patch text/plain 36.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2026-09-17 10:13:26 Re: Reject WAIT FOR earlier in transaction-snapshot mode
Previous Message Zhijie Hou (Fujitsu) 2026-09-17 10:10:01 RE: Race conditions in logical decoding