libq support for sslpassword connection param, DER format keys
authorAndrew Dunstan <andrew@dunslane.net>
Sat, 30 Nov 2019 20:27:13 +0000 (15:27 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Sat, 30 Nov 2019 20:27:13 +0000 (15:27 -0500)
commit4dc63552109f65cebbe168203bd62c5e4c753162
tree28d3567fed538ee2bd9e155309cecb30557c5200
parent3ff660bbeb96086cb1cf880bfb4e2e350cbd21b2
libq support for sslpassword connection param,  DER format keys

This patch providies for support for password protected SSL client
keys in libpq, and for DER format keys, both encrypted and unencrypted.
There is a new connection parameter sslpassword, which is supplied to
the OpenSSL libraries via a callback function. The callback function can
also be set by an application by calling PQgetSSLKeyPassHook(). There is
also a function to retreive the connection setting, PQsslpassword().

Craig Ringer and Andrew Dunstan

Reviewed by: Greg Nancarrow

Discussion: https://postgr.es/m/f7ee88ed-95c4-95c1-d4bf-7b415363ab62@2ndQuadrant.com
13 files changed:
contrib/dblink/expected/dblink.out
doc/src/sgml/libpq.sgml
doc/src/sgml/postgres-fdw.sgml
src/interfaces/libpq/exports.txt
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-secure-openssl.c
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h
src/test/ssl/Makefile
src/test/ssl/ssl/client-der.key [new file with mode: 0644]
src/test/ssl/ssl/client-encrypted-der.key [new file with mode: 0644]
src/test/ssl/ssl/client-encrypted-pem.key [new file with mode: 0644]
src/test/ssl/t/001_ssltests.pl