Provide a TLS init hook
authorAndrew Dunstan <[email protected]>
Wed, 25 Mar 2020 21:13:17 +0000 (17:13 -0400)
committerAndrew Dunstan <[email protected]>
Wed, 25 Mar 2020 21:13:17 +0000 (17:13 -0400)
commit896fcdb230e729652d37270c8606ccdc45212f0d
tree1aeb2f25ece8cd7412924bcbaca4a0499f7af01c
parentffd398021c296e55b59ab848ac71a1769ddff93f
Provide a TLS init hook

The default hook function sets the default password callback function.
In order to allow preloaded libraries to have an opportunity to override
the default, TLS initialization if now delayed slightly until after
shared preloaded libraries have been loaded.

A test module is provided which contains a trivial example that decodes
an obfuscated password for an SSL certificate.

Author: Andrew Dunstan
Reviewed By: Andreas Karlsson, Asaba Takanori
Discussion: https://postgr.es/m/04116472-818b-5859-1d74-3d995aab2252@2ndQuadrant.com
src/backend/libpq/be-secure-openssl.c
src/backend/postmaster/postmaster.c
src/include/libpq/libpq-be.h
src/test/modules/Makefile
src/test/modules/ssl_passphrase_callback/.gitignore [new file with mode: 0644]
src/test/modules/ssl_passphrase_callback/Makefile [new file with mode: 0644]
src/test/modules/ssl_passphrase_callback/server.crt [new file with mode: 0644]
src/test/modules/ssl_passphrase_callback/server.key [new file with mode: 0644]
src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c [new file with mode: 0644]
src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl [new file with mode: 0644]
src/tools/msvc/Mkvcbuild.pm