From 51e3005a072c3007b32634043c46673dd9decf03 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 29 Sep 2019 17:32:46 -0400 Subject: [PATCH] Allow SSL TAP tests to run on Windows Windows does not enforce key file permissions checks in libpq, and psql can produce CRLF line endings on Windows. Backpatch to Release 12 (CRLF) and Release 11 (permissions check) --- src/test/ssl/t/001_ssltests.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl index d5dcb465362..b5c5d1a40dd 100644 --- a/src/test/ssl/t/001_ssltests.pl +++ b/src/test/ssl/t/001_ssltests.pl @@ -332,11 +332,16 @@ test_connect_ok( "certificate authorization succeeds with correct client cert"); # client key with wrong permissions -test_connect_fails( - $common_connstr, - "user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key", - qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!, - "certificate authorization fails because of file permissions"); +SKIP: +{ + skip "Permissions check not enforced on Windows", 2 if ($windows_os); + + test_connect_fails( + $common_connstr, + "user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key", + qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!, + "certificate authorization fails because of file permissions"); +} # client cert belonging to another user test_connect_fails(