diff options
author | Tom Lane | 2022-09-30 14:26:47 +0000 |
---|---|---|
committer | Tom Lane | 2022-09-30 14:26:47 +0000 |
commit | 4e4f7b9fcc9ad0b023b6e698e978882d022b94c4 (patch) | |
tree | 95634bd5f8f74221e1780d1a507692bc4d1765a4 /doc/src | |
parent | 69298db8e1a5a7afcfeea32daf71e713a109ef93 (diff) |
Adjust PQsslAttributeNames() to match PQsslAttribute().
Currently, PQsslAttributeNames() returns the same list of attribute
names regardless of its conn parameter. This patch changes it to
have behavior parallel to what 80a05679d installed for PQsslAttribute:
you get OpenSSL's attributes if conn is NULL or is an SSL-encrypted
connection, or an empty list if conn is a non-encrypted connection.
The point of this is to have sensible connection-dependent behavior
in case we ever support multiple SSL libraries. The behavior for
NULL can be defined as "the attributes for the default SSL library",
parallel to what PQsslAttribute(NULL, "library") does.
Since this is mostly just future-proofing, no back-patch.
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/libpq.sgml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 026b0ec46bb..3c9bd3d6730 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -2590,12 +2590,22 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name); <term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</primary></indexterm></term> <listitem> <para> - Returns an array of SSL attribute names available. + Returns an array of SSL attribute names that can be used + in <function>PQsslAttribute()</function>. The array is terminated by a NULL pointer. <synopsis> const char * const * PQsslAttributeNames(const PGconn *conn); </synopsis> </para> + + <para> + If <literal>conn</literal> is NULL, the attributes available for the + default SSL library are returned, or an empty list + if <application>libpq</application> was compiled without any SSL + support. If <literal>conn</literal> is not NULL, the attributes + available for the SSL library in use for the connection are returned, + or an empty list if the connection is not encrypted. + </para> </listitem> </varlistentry> |