postgresql/src/tools
Michael Paquier 36f40ce2dc libpq: Add sslcertmode option to control client certificates
The sslcertmode option controls whether the server is allowed and/or
required to request a certificate from the client.  There are three
modes:
- "allow" is the default and follows the current behavior, where a
configured client certificate is sent if the server requests one
(via one of its default locations or sslcert).  With the current
implementation, will happen whenever TLS is negotiated.
- "disable" causes the client to refuse to send a client certificate
even if sslcert is configured or if a client certificate is available in
one of its default locations.
- "require" causes the client to fail if a client certificate is never
sent and the server opens a connection anyway.  This doesn't add any
additional security, since there is no guarantee that the server is
validating the certificate correctly, but it may helpful to troubleshoot
more complicated TLS setups.

sslcertmode=require requires SSL_CTX_set_cert_cb(), available since
OpenSSL 1.0.2.  Note that LibreSSL does not include it.

Using a connection parameter different than require_auth has come up as
the simplest design because certificate authentication does not rely
directly on any of the AUTH_REQ_* codes, and one may want to require a
certificate to be sent in combination of a given authentication method,
like SCRAM-SHA-256.

TAP tests are added in src/test/ssl/, some of them relying on sslinfo to
check if a certificate has been set.  These are compatible across all
the versions of OpenSSL supported on HEAD (currently down to 1.0.1).

Author: Jacob Champion
Reviewed-by: Aleksander Alekseev, Peter Eisentraut, David G. Johnston,
Michael Paquier
Discussion: https://postgr.es/m/9e5a8ccddb8355ea9fa4b75a1e3a9edc88a70cd3.camel@vmware.com
2023-03-24 13:34:26 +09:00
..
ci ci: Add task testing windows with mingw 2022-11-17 16:22:25 -08:00
editors Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
ifaddrs Update copyright for 2023 2023-01-02 15:00:37 -05:00
msvc libpq: Add sslcertmode option to control client certificates 2023-03-24 13:34:26 +09:00
perlcheck doc: update metacpan.org links to avoid redirects 2022-11-16 10:24:37 +01:00
pg_bsd_indent Add missing "-I." flag when building pg_bsd_indent. 2023-03-23 13:01:44 -04:00
pginclude Tighten header pre-inclusions in headerscheck and cpluspluscheck. 2023-03-04 12:11:50 -05:00
pgindent Allow locking updated tuples in tuple_update() and tuple_delete() 2023-03-23 00:26:59 +03:00
ccsym tools/ccsym: update for modern versions of gcc 2015-01-20 13:02:58 -05:00
check_bison_recursion.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
codelines Fix remaining stray references to CVS. 2010-09-22 19:51:39 -04:00
copyright.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
darwin_sysroot Move darwin sysroot determination into separate file 2022-09-01 16:54:19 -07:00
find_badmacros Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
find_meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
find_static Fix trap in a few shell scripts 2022-09-20 18:50:16 +02:00
find_typedef Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
fix-old-flex-code.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
gen_export.pl meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
gen_keywordlist.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
git-external-diff Preserve information on use of git-external-diff 2018-05-24 23:45:31 +09:30
git_changelog Update copyright for 2023 2023-01-02 15:00:37 -05:00
install_files meson: make install_test_files more generic, rename to install_files 2023-03-23 21:20:18 -07:00
make_ctags Fix make_etags failure on Mac. 2023-02-15 09:52:42 +09:00
make_etags Fix make_etags failure on Mac. 2023-02-15 09:52:42 +09:00
make_mkid Add another pgdefine path check, and a cvs-git change. 2011-08-26 21:52:35 -04:00
mark_pgdllimport.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
PerfectHash.pm Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgflex meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pgtest Fix trap in a few shell scripts 2022-09-20 18:50:16 +02:00
rcgen meson: Add windows resource files 2022-10-05 09:56:05 -07:00
RELEASE_CHANGES Add defenses against unexpected changes in the NodeTag enum list. 2022-07-12 11:22:52 -04:00
testint128.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
testwrap meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
valgrind.supp Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
version_stamp.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00
win32tzlist.pl Update copyright for 2023 2023-01-02 15:00:37 -05:00