summaryrefslogtreecommitdiff
path: root/src/test/ssl/t/SSL/Backend/OpenSSL.pm
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-05-09 11:50:33 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-05-09 11:50:33 -0400
commit0aaf69965dbd92072911cc46e4b28b9a37c38fad (patch)
tree96d0a30f2166842e1ebef656a4a54fdc146824b8 /src/test/ssl/t/SSL/Backend/OpenSSL.pm
parentbc35adee8d7ad38e7bef40052f196be55decddec (diff)
Centralize ssl tests' check for whether we're using LibreSSL.
Right now there's only one caller, so that this is merely an exercise in shoving code from one module to another, but there will shortly be another one. It seems better to avoid having two copies of this highly-subject-to-change test. Back-patch to v15, where we first introduced some tests that don't work with LibreSSL. Reported-by: Thomas Munro <thomas.munro@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CA+hUKG+fLqyweHqFSBcErueUVT0vDuSNWui-ySz3+d_APmq7dw@mail.gmail.com Backpatch-through: 15
Diffstat (limited to 'src/test/ssl/t/SSL/Backend/OpenSSL.pm')
-rw-r--r--src/test/ssl/t/SSL/Backend/OpenSSL.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ssl/t/SSL/Backend/OpenSSL.pm b/src/test/ssl/t/SSL/Backend/OpenSSL.pm
index e044318531f..4159addb700 100644
--- a/src/test/ssl/t/SSL/Backend/OpenSSL.pm
+++ b/src/test/ssl/t/SSL/Backend/OpenSSL.pm
@@ -26,6 +26,7 @@ package SSL::Backend::OpenSSL;
use strict;
use warnings FATAL => 'all';
+use PostgreSQL::Test::Utils;
use File::Basename;
use File::Copy;
@@ -205,6 +206,23 @@ sub get_library
return $self->{_library};
}
+=pod
+
+=item $backend->library_is_libressl()
+
+Detect whether the SSL library is LibreSSL.
+
+=cut
+
+sub library_is_libressl
+{
+ my ($self) = @_;
+
+ # The HAVE_SSL_CTX_SET_CERT_CB macro isn't defined for LibreSSL.
+ # We may eventually need a less-bogus heuristic.
+ return not check_pg_config("#define HAVE_SSL_CTX_SET_CERT_CB 1");
+}
+
# Internal method for copying a set of files, taking into account wildcards
sub _copy_files
{