SSL TAP test backend library independence refactoring
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Sat, 26 Mar 2022 21:00:39 +0000 (22:00 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Sat, 26 Mar 2022 21:00:39 +0000 (22:00 +0100)
commit4a7e964fc67a541b6ea1b72729ad3f8e632d003c
treed1907da1a974fbfb21e789c4edb69135e7075de7
parente07d4ddc55fdcf82082950b3eb0cd8f728284c9d
SSL TAP test backend library independence refactoring

The SSL TAP tests were tightly coupled to the OpenSSL implementation,
making it hard to add support for additional SSL/TLS backends.  This
refactoring makes the test avoid depending on specific implementations

The SSLServer Perl module is renamed SSL::Server, which in turn use
SSL::Backend::X where X is the backend pointed to by with_ssl.  Each
backend will implement its own module responsible for setting up keys,
certs and to resolve sslkey values to their implementation specific
value (file paths or vault nicknames etc). Further, switch_server_cert
now takes a set of named parameters rather than a fixed set which used
defaults. The modules also come with POD documentation.

There are a few testcases which still use OpenSSL specifics, but it's
not entirely clear how to abstract those until we have another library
implemented.

Original patch by me, with lots of rework by Andrew Dunstan to turn it
into better Perl.

Discussion: https://postgr.es/m/AA18A362-CA65-4F9A-AF61-76AE318FE97C@yesql.se
src/test/ssl/t/001_ssltests.pl
src/test/ssl/t/002_scram.pl
src/test/ssl/t/003_sslinfo.pl
src/test/ssl/t/SSL/Backend/OpenSSL.pm [new file with mode: 0644]
src/test/ssl/t/SSL/Server.pm [new file with mode: 0644]
src/test/ssl/t/SSLServer.pm [deleted file]