@@ -2515,8 +2515,9 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
25152515
25162516 <para>
25172517 The list of available attributes varies depending on the SSL library
2518- being used, and the type of connection. If an attribute is not
2519- available, returns NULL.
2518+ being used and the type of connection. Returns NULL if the connection
2519+ does not use SSL or the specified attribute name is not defined for the
2520+ library in use.
25202521 </para>
25212522
25222523 <para>
@@ -2575,12 +2576,15 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
25752576
25762577 <para>
25772578 As a special case, the <literal>library</literal> attribute may be
2578- queried without an existing connection by passing NULL as the
2579- <literal>conn</literal> argument. The historical behavior was to return
2580- NULL for any attribute when a NULL <literal>conn</literal> was provided;
2581- client programs needing to differentiate between the newer and older
2582- implementations may check the
2583- <literal>LIBPQ_HAS_SSL_LIBRARY_DETECTION</literal> feature macro.
2579+ queried without a connection by passing NULL as
2580+ the <literal>conn</literal> argument. The result will be the default
2581+ SSL library name, or NULL if <application>libpq</application> was
2582+ compiled without any SSL support. (Prior
2583+ to <productname>PostgreSQL</productname> version 15, passing NULL as
2584+ the <literal>conn</literal> argument always resulted in NULL.
2585+ Client programs needing to differentiate between the newer and older
2586+ implementations of this case may check the
2587+ <literal>LIBPQ_HAS_SSL_LIBRARY_DETECTION</literal> feature macro.)
25842588 </para>
25852589 </listitem>
25862590 </varlistentry>
@@ -2589,7 +2593,8 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
25892593 <term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</primary></indexterm></term>
25902594 <listitem>
25912595 <para>
2592- Return an array of SSL attribute names available. The array is terminated by a NULL pointer.
2596+ Returns an array of SSL attribute names available.
2597+ The array is terminated by a NULL pointer.
25932598<synopsis>
25942599const char * const * PQsslAttributeNames(const PGconn *conn);
25952600</synopsis>
@@ -2601,17 +2606,20 @@ const char * const * PQsslAttributeNames(const PGconn *conn);
26012606 <term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</primary></indexterm></term>
26022607 <listitem>
26032608 <para>
2604- Return a pointer to an SSL-implementation-specific object describing
2605- the connection.
2609+ Returns a pointer to an SSL-implementation-specific object describing
2610+ the connection. Returns NULL if the connection is not encrypted
2611+ or the requested type of object is not available from the connection's
2612+ SSL implementation.
26062613<synopsis>
26072614void *PQsslStruct(const PGconn *conn, const char *struct_name);
26082615</synopsis>
26092616 </para>
26102617 <para>
26112618 The struct(s) available depend on the SSL implementation in use.
26122619 For <productname>OpenSSL</productname>, there is one struct,
2613- available under the name "OpenSSL", and it returns a pointer to the
2614- <productname>OpenSSL</productname> <literal>SSL</literal> struct.
2620+ available under the name <literal>OpenSSL</literal>,
2621+ and it returns a pointer to
2622+ <productname>OpenSSL</productname>'s <literal>SSL</literal> struct.
26152623 To use this function, code along the following lines could be used:
26162624<programlisting><![CDATA[
26172625#include <libpq-fe.h>
@@ -2644,7 +2652,7 @@ void *PQsslStruct(const PGconn *conn, const char *struct_name);
26442652 <listitem>
26452653 <para>
26462654 <indexterm><primary>SSL</primary><secondary sortas="libpq">in libpq</secondary></indexterm>
2647- Returns the SSL structure used in the connection, or null
2655+ Returns the SSL structure used in the connection, or NULL
26482656 if SSL is not in use.
26492657
26502658<synopsis>
0 commit comments