pgsql: Enable SSL library detection via PQsslAttribute()

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Enable SSL library detection via PQsslAttribute()
Date: 2022-03-29 12:07:50
Message-ID: E1nZAdZ-001toy-NL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Enable SSL library detection via PQsslAttribute()

Currently, libpq client code must have a connection handle
before it can query the "library" SSL attribute. This poses
problems if the client needs to know what SSL library is in
use before constructing a connection string.

Allow PQsslAttribute(NULL, "library") to return the library
in use -- currently, just "OpenSSL" or NULL. The new behavior
is announced with the LIBPQ_HAS_SSL_LIBRARY_DETECTION feature
macro, allowing clients to differentiate between a libpq that
was compiled without SSL support and a libpq that's just too
old to tell.

Author: Jacob Champion <pchampion(at)vmware(dot)com>
Reviewed-by: Robert Haas <robertmhaas(at)gmail(dot)com>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/4c8b76ef434a96627170a31c3acd33cbfd6e41f1.camel@vmware.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ebc8b7d4416d8e0dfb7c05132ef6182fd3daf885

Modified Files
--------------
doc/src/sgml/libpq.sgml | 10 +++++++++
src/interfaces/libpq/Makefile | 1 +
src/interfaces/libpq/fe-secure-openssl.c | 6 +++---
src/interfaces/libpq/libpq-fe.h | 2 ++
src/interfaces/libpq/t/002_api.pl | 20 +++++++++++++++++
src/interfaces/libpq/test/.gitignore | 1 +
src/interfaces/libpq/test/Makefile | 2 +-
src/interfaces/libpq/test/testclient.c | 37 ++++++++++++++++++++++++++++++++
8 files changed, 75 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-03-29 13:04:29 pgsql: doc: Make UPDATE FROM examples consistent
Previous Message Peter Eisentraut 2022-03-29 07:01:42 pgsql: psql: Add test for psql behavior on server crash