mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add ssl_library preset parameter
This allows querying the SSL implementation used on the server side. It's analogous to using PQsslAttribute(conn, "library") in libpq. Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
This commit is contained in:
@ -38,6 +38,7 @@
|
||||
#include "storage/proc.h"
|
||||
|
||||
|
||||
char *ssl_library;
|
||||
char *ssl_cert_file;
|
||||
char *ssl_key_file;
|
||||
char *ssl_ca_file;
|
||||
|
@ -3723,6 +3723,21 @@ static struct config_string ConfigureNamesString[] =
|
||||
check_canonical_path, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"ssl_library", PGC_INTERNAL, PRESET_OPTIONS,
|
||||
gettext_noop("Name of the SSL library."),
|
||||
NULL,
|
||||
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
|
||||
},
|
||||
&ssl_library,
|
||||
#ifdef USE_SSL
|
||||
"OpenSSL",
|
||||
#else
|
||||
"",
|
||||
#endif
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"ssl_cert_file", PGC_SIGHUP, CONN_AUTH_SSL,
|
||||
gettext_noop("Location of the SSL server certificate file."),
|
||||
|
@ -75,6 +75,7 @@ extern int pq_putbytes(const char *s, size_t len);
|
||||
/*
|
||||
* prototypes for functions in be-secure.c
|
||||
*/
|
||||
extern char *ssl_library;
|
||||
extern char *ssl_cert_file;
|
||||
extern char *ssl_key_file;
|
||||
extern char *ssl_ca_file;
|
||||
|
@ -8,7 +8,7 @@ use File::Copy;
|
||||
|
||||
if ($ENV{with_openssl} eq 'yes')
|
||||
{
|
||||
plan tests => 64;
|
||||
plan tests => 65;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -49,6 +49,11 @@ $node->init;
|
||||
$ENV{PGHOST} = $node->host;
|
||||
$ENV{PGPORT} = $node->port;
|
||||
$node->start;
|
||||
|
||||
# Run this before we lock down access below.
|
||||
my $result = $node->safe_psql('postgres', "SHOW ssl_library");
|
||||
is($result, 'OpenSSL', 'ssl_library parameter');
|
||||
|
||||
configure_test_server_for_ssl($node, $SERVERHOSTADDR, 'trust');
|
||||
|
||||
note "testing password-protected keys";
|
||||
|
Reference in New Issue
Block a user