summaryrefslogtreecommitdiff
path: root/src/test/ssl
diff options
context:
space:
mode:
authorTom Lane2020-05-14 17:06:38 +0000
committerTom Lane2020-05-14 17:06:50 +0000
commit5cbfce562f7cd2aab0cdc4694ce298ec3567930e (patch)
tree64e722d72fc5f1803cb6f6371d6cf12863e2812f /src/test/ssl
parent1255466f8358ecac29581aa5ecec76628dc2e33c (diff)
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up, most of which weren't per project style anyway. Notably, it seems some people didn't absorb the style rules of commit c9d297751, because there were a bunch of new occurrences of function calls with a newline just after the left paren, all with faulty expectations about how the rest of the call would get indented.
Diffstat (limited to 'src/test/ssl')
-rw-r--r--src/test/ssl/t/001_ssltests.pl47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl
index 3e68a49ca93..a454bb0274a 100644
--- a/src/test/ssl/t/001_ssltests.pl
+++ b/src/test/ssl/t/001_ssltests.pl
@@ -37,13 +37,17 @@ my $common_connstr;
#
# This changes ssl/client.key to ssl/client_tmp.key etc for the rest
# of the tests.
-my @keys = ("client", "client-revoked", "client-der", "client-encrypted-pem", "client-encrypted-der");
+my @keys = (
+ "client", "client-revoked",
+ "client-der", "client-encrypted-pem",
+ "client-encrypted-der");
foreach my $key (@keys)
{
- copy("ssl/${key}.key", "ssl/${key}_tmp.key")
- or die "couldn't copy ssl/${key}.key to ssl/${key}_tmp.key for permissions change: $!";
- chmod 0600, "ssl/${key}_tmp.key"
- or die "failed to change permissions on ssl/${key}_tmp.key: $!";
+ copy("ssl/${key}.key", "ssl/${key}_tmp.key")
+ or die
+ "couldn't copy ssl/${key}.key to ssl/${key}_tmp.key for permissions change: $!";
+ chmod 0600, "ssl/${key}_tmp.key"
+ or die "failed to change permissions on ssl/${key}_tmp.key: $!";
}
# Also make a copy of that explicitly world-readable. We can't
@@ -99,15 +103,17 @@ $node->_update_pid(1);
# Test compatibility of SSL protocols.
# TLSv1.1 is lower than TLSv1.2, so it won't work.
-$node->append_conf('postgresql.conf',
- qq{ssl_min_protocol_version='TLSv1.2'
+$node->append_conf(
+ 'postgresql.conf',
+ qq{ssl_min_protocol_version='TLSv1.2'
ssl_max_protocol_version='TLSv1.1'});
command_fails(
[ 'pg_ctl', '-D', $node->data_dir, '-l', $node->logfile, 'restart' ],
'restart fails with incorrect SSL protocol bounds');
# Go back to the defaults, this works.
-$node->append_conf('postgresql.conf',
- qq{ssl_min_protocol_version='TLSv1.2'
+$node->append_conf(
+ 'postgresql.conf',
+ qq{ssl_min_protocol_version='TLSv1.2'
ssl_max_protocol_version=''});
command_ok(
[ 'pg_ctl', '-D', $node->data_dir, '-l', $node->logfile, 'restart' ],
@@ -395,32 +401,37 @@ test_connect_fails(
test_connect_ok(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_tmp.key",
- "certificate authorization succeeds with correct client cert in PEM format");
+ "certificate authorization succeeds with correct client cert in PEM format"
+);
# correct client cert in unencrypted DER
test_connect_ok(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-der_tmp.key",
- "certificate authorization succeeds with correct client cert in DER format");
+ "certificate authorization succeeds with correct client cert in DER format"
+);
# correct client cert in encrypted PEM
test_connect_ok(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key sslpassword='dUmmyP^#+'",
- "certificate authorization succeeds with correct client cert in encrypted PEM format");
+ "certificate authorization succeeds with correct client cert in encrypted PEM format"
+);
# correct client cert in encrypted DER
test_connect_ok(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-der_tmp.key sslpassword='dUmmyP^#+'",
- "certificate authorization succeeds with correct client cert in encrypted DER format");
+ "certificate authorization succeeds with correct client cert in encrypted DER format"
+);
# correct client cert in encrypted PEM with wrong password
test_connect_fails(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key sslpassword='wrong'",
qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": bad decrypt\E!,
- "certificate authorization fails with correct client cert and wrong password in encrypted PEM format");
+ "certificate authorization fails with correct client cert and wrong password in encrypted PEM format"
+);
TODO:
{
@@ -434,14 +445,16 @@ TODO:
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key sslpassword=''",
qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!,
- "certificate authorization fails with correct client cert and empty password in encrypted PEM format");
+ "certificate authorization fails with correct client cert and empty password in encrypted PEM format"
+ );
# correct client cert in encrypted PEM with no password
test_connect_fails(
$common_connstr,
"user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key",
qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!,
- "certificate authorization fails with correct client cert and no password in encrypted PEM format");
+ "certificate authorization fails with correct client cert and no password in encrypted PEM format"
+ );
}
@@ -533,5 +546,5 @@ test_connect_fails($common_connstr, "sslmode=require sslcert=ssl/client.crt",
# clean up
foreach my $key (@keys)
{
- unlink("ssl/${key}_tmp.key");
+ unlink("ssl/${key}_tmp.key");
}