pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: threadsafety for SSL certificate callback
Date: Wed, 12 Nov 2025 11:39:43 +0000
Message-ID: <E1vJ9CR-006EHt-0d@gemulon.postgresql.org> (raw)

libpq: threadsafety for SSL certificate callback

In order to make the errorhandling code in backend libpq be thread-
safe the global variable used by the certificate verification call-
back need to be replaced with passing private data.

This moves the threadsafety needle a little but forwards, the call
to strerror_r also needs to be replaced with the error buffer made
thread local.  This is left as future work for when add the thread
primitives required for this to the tree.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/353226C7-97A1-4507-A380-36AA92983AE6@yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9122ff65a1be0fe4d55a34c6d6f7403209f326aa

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)



Message-ID: <E1vJ9CR-006EHt-0d@gemulon.postgresql.org>
Permalink:  ../E1vJ9CR-006EHt-0d@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vJ9CR-006EHt-0d@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: libpq: threadsafety for SSL certificate callback
  In-Reply-To: <E1vJ9CR-006EHt-0d@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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