# root, but the server's key is signed by the server CA.)
$node->connect_fails(
"$common_connstr sslrootcert=ssl/client_ca.crt sslmode=require",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"connect with wrong server root cert sslmode=require");
$node->connect_fails(
"$common_connstr sslrootcert=ssl/client_ca.crt sslmode=verify-ca",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"connect with wrong server root cert sslmode=verify-ca");
$node->connect_fails(
"$common_connstr sslrootcert=ssl/client_ca.crt sslmode=verify-full",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"connect with wrong server root cert sslmode=verify-full");
# Try with just the server CA's cert. This fails because the root file
# must contain the whole chain up to the root CA.
$node->connect_fails(
"$common_connstr sslrootcert=ssl/server_ca.crt sslmode=verify-ca",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"connect with server CA cert, without root CA");
# And finally, with the correct root cert.
# A CRL belonging to a different CA is not accepted, fails
$node->connect_fails(
"$common_connstr sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/client.crl",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"CRL belonging to a different CA");
# The same for CRL directory
$node->connect_fails(
"$common_connstr sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrldir=ssl/client-crldir",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"directory CRL belonging to a different CA");
# With the correct CRL, succeeds (this cert is not revoked)
"connects without client-side CRL");
$node->connect_fails(
"$common_connstr sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrl=ssl/root+server.crl",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"does not connect with client-side CRL file");
$node->connect_fails(
"$common_connstr sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca sslcrldir=ssl/root+server-crldir",
- qr/SSL error/,
+ qr/SSL error: certificate verify failed/,
"does not connect with client-side CRL directory");
# pg_stat_ssl
# revoked client cert
$node->connect_fails(
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked.crt sslkey=ssl/client-revoked_tmp.key",
- qr/SSL error/,
+ qr/SSL error: sslv3 alert certificate revoked/,
"certificate authorization fails with revoked client cert");
# Check that connecting with auth-option verify-full in pg_hba:
$node->connect_fails(
"$common_connstr user=anotheruser sslcert=ssl/client.crt sslkey=ssl/client_tmp.key",
- qr/FATAL/,
+ qr/FATAL: .* "trust" authentication failed for user "anotheruser"/,
"auth_option clientcert=verify-full fails with mismatching username and Common Name"
);
"intermediate client certificate is provided by client");
$node->connect_fails(
$common_connstr . " " . "sslmode=require sslcert=ssl/client.crt",
- qr/SSL error/, "intermediate client certificate is missing");
+ qr/SSL error: tlsv1 alert unknown ca/, "intermediate client certificate is missing");
# test server-side CRL directory
switch_server_cert($node, 'server-cn-only', undef, undef, 'root+client-crldir');
# revoked client cert
$node->connect_fails(
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked.crt sslkey=ssl/client-revoked_tmp.key",
- qr/SSL error/,
+ qr/SSL error: sslv3 alert certificate revoked/,
"certificate authorization fails with revoked client cert with server-side CRL directory");
# clean up