diff options
author | Jeff Davis <jdavis@postgresql.org> | 2019-09-23 13:45:23 -0700 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2019-09-23 14:03:35 -0700 |
commit | d6e612f837e235db0411e8b67558c9a6b3e9f41f (patch) | |
tree | a677e3cfdfc4f086b5272dcae746af4243d3ea2e /src/test/ssl/t/SSLServer.pm | |
parent | 13cd97e6c8c9679a9b2384c22a4f0333b1a5cc55 (diff) | |
download | postgresql-d6e612f837e235db0411e8b67558c9a6b3e9f41f.tar.gz postgresql-d6e612f837e235db0411e8b67558c9a6b3e9f41f.zip |
Add libpq parameter 'channel_binding'.
Allow clients to require channel binding to enhance security against
untrusted servers.
Author: Jeff Davis
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/227015d8417f2b4fef03f8966dbfa5cbcc4f44da.camel%40j-davis.com
Diffstat (limited to 'src/test/ssl/t/SSLServer.pm')
-rw-r--r-- | src/test/ssl/t/SSLServer.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/ssl/t/SSLServer.pm b/src/test/ssl/t/SSLServer.pm index d25c38dbbc7..005955a2ff7 100644 --- a/src/test/ssl/t/SSLServer.pm +++ b/src/test/ssl/t/SSLServer.pm @@ -102,6 +102,7 @@ sub configure_test_server_for_ssl # Create test users and databases $node->psql('postgres', "CREATE USER ssltestuser"); + $node->psql('postgres', "CREATE USER md5testuser"); $node->psql('postgres', "CREATE USER anotheruser"); $node->psql('postgres', "CREATE USER yetanotheruser"); $node->psql('postgres', "CREATE DATABASE trustdb"); @@ -114,6 +115,10 @@ sub configure_test_server_for_ssl $node->psql('postgres', "SET password_encryption='$password_enc'; ALTER USER ssltestuser PASSWORD '$password';" ); + # A special user that always has an md5-encrypted password + $node->psql('postgres', + "SET password_encryption='md5'; ALTER USER md5testuser PASSWORD '$password';" + ); $node->psql('postgres', "SET password_encryption='$password_enc'; ALTER USER anotheruser PASSWORD '$password';" ); @@ -128,7 +133,7 @@ sub configure_test_server_for_ssl print $conf "log_statement=all\n"; # enable SSL and set up server key - print $conf "include 'sslconfig.conf'"; + print $conf "include 'sslconfig.conf'\n"; close $conf; @@ -187,6 +192,8 @@ sub configure_hba_for_ssl print $hba "# TYPE DATABASE USER ADDRESS METHOD OPTIONS\n"; print $hba + "hostssl trustdb md5testuser $serverhost/32 md5\n"; + print $hba "hostssl trustdb all $serverhost/32 $authmethod\n"; print $hba "hostssl trustdb all ::1/128 $authmethod\n"; |