mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Add tests for errors during SSL or GSSAPI handshake
These test that libpq correctly falls back to a plaintext connection on handshake error, in the "prefer" modes. Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/CAOYmi%2Bnwvu21mJ4DYKUa98HdfM_KZJi7B1MhyXtnsyOO-PB6Ww%40mail.gmail.com
This commit is contained in:
@@ -339,6 +339,16 @@ nossluser . disable postgres connect, authok
|
||||
"user=testuser sslmode=prefer",
|
||||
'connect, v2error -> fail');
|
||||
$node->restart;
|
||||
|
||||
$node->safe_psql(
|
||||
'postgres',
|
||||
"SELECT injection_points_attach('backend-ssl-startup', 'error');",
|
||||
connstr => "user=localuser host=$unixdir");
|
||||
connect_test(
|
||||
$node,
|
||||
"user=testuser sslmode=prefer",
|
||||
'connect, sslaccept, backenderror, reconnect, authok -> plain');
|
||||
$node->restart;
|
||||
}
|
||||
|
||||
# Disable SSL again
|
||||
@@ -444,6 +454,16 @@ nogssuser disable disable postgres connect, authok
|
||||
"user=testuser gssencmode=prefer sslmode=disable",
|
||||
'connect, v2error -> fail');
|
||||
$node->restart;
|
||||
|
||||
$node->safe_psql(
|
||||
'postgres',
|
||||
"SELECT injection_points_attach('backend-gssapi-startup', 'error');",
|
||||
connstr => "user=localuser host=$unixdir");
|
||||
connect_test(
|
||||
$node,
|
||||
"user=testuser gssencmode=prefer sslmode=disable",
|
||||
'connect, gssaccept, backenderror, reconnect, authok -> plain');
|
||||
$node->restart;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user