Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1ddb9e1

Browse files
committed
Centralize ssl tests' check for whether we're using LibreSSL.
Right now there's only one caller, so that this is merelyan exercise in shoving code from one module to another,but there will shortly be another one. It seems better toavoid having two copies of this highly-subject-to-change test.Back-patch to v15, where we first introduced some tests thatdon'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.comBackpatch-through: 15
1 parent5261b40 commit1ddb9e1

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

‎src/test/ssl/t/SSL/Backend/OpenSSL.pm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package SSL::Backend::OpenSSL;
2626

2727
use strict;
2828
use warnings;
29+
use PostgreSQL::Test::Utils;
2930
use File::Basename;
3031
use File::Copy;
3132

@@ -204,6 +205,25 @@ sub get_library
204205
return$self->{_library};
205206
}
206207

208+
=pod
209+
210+
=item$backend->library_is_libressl()
211+
212+
Detect whether the SSL library is LibreSSL.
213+
214+
=cut
215+
216+
sublibrary_is_libressl
217+
{
218+
my ($self) =@_;
219+
220+
# The HAVE_SSL_CTX_SET_CERT_CB macro isn't defined for LibreSSL.
221+
# (Nor for OpenSSL 1.0.1, but that's old enough that accommodating it
222+
# isn't worth the cost.)
223+
# We may eventually need a less-bogus heuristic.
224+
returnnot check_pg_config("#define HAVE_SSL_CTX_SET_CERT_CB 1");
225+
}
226+
207227
# Internal method for copying a set of files, taking into account wildcards
208228
sub_copy_files
209229
{

‎src/test/ssl/t/SSL/Server.pm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ sub ssl_library
243243

244244
=pod
245245
246+
=item$server->is_libressl()
247+
248+
Detect whether the currently used SSL backend is LibreSSL.
249+
(Ideally we'd not need this hack, but presently we do.)
250+
251+
=cut
252+
253+
subis_libressl
254+
{
255+
my$self =shift;
256+
my$backend =$self->{backend};
257+
258+
return$backend->library_is_libressl();
259+
}
260+
261+
=pod
262+
246263
=itemswitch_server_cert(params)
247264
248265
Change the configuration to use the given set of certificate, key, ca and

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp