Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98efa76

Browse files
committed
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>
1 parentab87b8f commit98efa76

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8401,6 +8401,22 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
84018401
</listitem>
84028402
</varlistentry>
84038403

8404+
<varlistentry id="guc-ssl-library" xreflabel="ssl_library">
8405+
<term><varname>ssl_library</varname> (<type>string</type>)
8406+
<indexterm>
8407+
<primary><varname>ssl_library</varname> configuration parameter</primary>
8408+
</indexterm>
8409+
</term>
8410+
<listitem>
8411+
<para>
8412+
Reports the name of the SSL library that this PostgreSQL server was
8413+
built with (even if SSL is not currently configured or in use on this
8414+
instance), for example <literal>OpenSSL</literal>, or an empty string
8415+
if none.
8416+
</para>
8417+
</listitem>
8418+
</varlistentry>
8419+
84048420
<varlistentry id="guc-wal-block-size" xreflabel="wal_block_size">
84058421
<term><varname>wal_block_size</varname> (<type>integer</type>)
84068422
<indexterm>

‎src/backend/libpq/be-secure.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include"storage/proc.h"
3939

4040

41+
char*ssl_library;
4142
char*ssl_cert_file;
4243
char*ssl_key_file;
4344
char*ssl_ca_file;

‎src/backend/utils/misc/guc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,6 +3723,21 @@ static struct config_string ConfigureNamesString[] =
37233723
check_canonical_path,NULL,NULL
37243724
},
37253725

3726+
{
3727+
{"ssl_library",PGC_INTERNAL,PRESET_OPTIONS,
3728+
gettext_noop("Name of the SSL library."),
3729+
NULL,
3730+
GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE
3731+
},
3732+
&ssl_library,
3733+
#ifdefUSE_SSL
3734+
"OpenSSL",
3735+
#else
3736+
"",
3737+
#endif
3738+
NULL,NULL,NULL
3739+
},
3740+
37263741
{
37273742
{"ssl_cert_file",PGC_SIGHUP,CONN_AUTH_SSL,
37283743
gettext_noop("Location of the SSL server certificate file."),

‎src/include/libpq/libpq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ extern intpq_putbytes(const char *s, size_t len);
7575
/*
7676
* prototypes for functions in be-secure.c
7777
*/
78+
externchar*ssl_library;
7879
externchar*ssl_cert_file;
7980
externchar*ssl_key_file;
8081
externchar*ssl_ca_file;

‎src/test/ssl/t/001_ssltests.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if ($ENV{with_openssl}eq'yes')
1010
{
11-
plantests=>64;
11+
plantests=>65;
1212
}
1313
else
1414
{
@@ -49,6 +49,11 @@
4949
$ENV{PGHOST} =$node->host;
5050
$ENV{PGPORT} =$node->port;
5151
$node->start;
52+
53+
# Run this before we lock down access below.
54+
my$result =$node->safe_psql('postgres',"SHOW ssl_library");
55+
is($result,'OpenSSL','ssl_library parameter');
56+
5257
configure_test_server_for_ssl($node,$SERVERHOSTADDR,'trust');
5358

5459
note"testing password-protected keys";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp