@@ -2515,8 +2515,9 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2515
2515
2516
2516
<para>
2517
2517
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.
2520
2521
</para>
2521
2522
2522
2523
<para>
@@ -2575,12 +2576,15 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2575
2576
2576
2577
<para>
2577
2578
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.)
2584
2588
</para>
2585
2589
</listitem>
2586
2590
</varlistentry>
@@ -2589,7 +2593,8 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2589
2593
<term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</primary></indexterm></term>
2590
2594
<listitem>
2591
2595
<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.
2593
2598
<synopsis>
2594
2599
const char * const * PQsslAttributeNames(const PGconn *conn);
2595
2600
</synopsis>
@@ -2601,17 +2606,20 @@ const char * const * PQsslAttributeNames(const PGconn *conn);
2601
2606
<term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</primary></indexterm></term>
2602
2607
<listitem>
2603
2608
<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.
2606
2613
<synopsis>
2607
2614
void *PQsslStruct(const PGconn *conn, const char *struct_name);
2608
2615
</synopsis>
2609
2616
</para>
2610
2617
<para>
2611
2618
The struct(s) available depend on the SSL implementation in use.
2612
2619
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.
2615
2623
To use this function, code along the following lines could be used:
2616
2624
<programlisting><![CDATA[
2617
2625
#include <libpq-fe.h>
@@ -2644,7 +2652,7 @@ void *PQsslStruct(const PGconn *conn, const char *struct_name);
2644
2652
<listitem>
2645
2653
<para>
2646
2654
<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
2648
2656
if SSL is not in use.
2649
2657
2650
2658
<synopsis>
0 commit comments