@@ -2514,8 +2514,9 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2514
2514
2515
2515
<para>
2516
2516
The list of available attributes varies depending on the SSL library
2517
- being used, and the type of connection. If an attribute is not
2518
- available, returns NULL.
2517
+ being used and the type of connection. Returns NULL if the connection
2518
+ does not use SSL or the specified attribute name is not defined for the
2519
+ library in use.
2519
2520
</para>
2520
2521
2521
2522
<para>
@@ -2574,12 +2575,15 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2574
2575
2575
2576
<para>
2576
2577
As a special case, the <literal>library</literal> attribute may be
2577
- queried without an existing connection by passing NULL as the
2578
- <literal>conn</literal> argument. The historical behavior was to return
2579
- NULL for any attribute when a NULL <literal>conn</literal> was provided;
2580
- client programs needing to differentiate between the newer and older
2581
- implementations may check the
2582
- <literal>LIBPQ_HAS_SSL_LIBRARY_DETECTION</literal> feature macro.
2578
+ queried without a connection by passing NULL as
2579
+ the <literal>conn</literal> argument. The result will be the default
2580
+ SSL library name, or NULL if <application>libpq</application> was
2581
+ compiled without any SSL support. (Prior
2582
+ to <productname>PostgreSQL</productname> version 15, passing NULL as
2583
+ the <literal>conn</literal> argument always resulted in NULL.
2584
+ Client programs needing to differentiate between the newer and older
2585
+ implementations of this case may check the
2586
+ <literal>LIBPQ_HAS_SSL_LIBRARY_DETECTION</literal> feature macro.)
2583
2587
</para>
2584
2588
</listitem>
2585
2589
</varlistentry>
@@ -2588,7 +2592,8 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
2588
2592
<term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</primary></indexterm></term>
2589
2593
<listitem>
2590
2594
<para>
2591
- Return an array of SSL attribute names available. The array is terminated by a NULL pointer.
2595
+ Returns an array of SSL attribute names available.
2596
+ The array is terminated by a NULL pointer.
2592
2597
<synopsis>
2593
2598
const char * const * PQsslAttributeNames(const PGconn *conn);
2594
2599
</synopsis>
@@ -2600,17 +2605,20 @@ const char * const * PQsslAttributeNames(const PGconn *conn);
2600
2605
<term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</primary></indexterm></term>
2601
2606
<listitem>
2602
2607
<para>
2603
- Return a pointer to an SSL-implementation-specific object describing
2604
- the connection.
2608
+ Returns a pointer to an SSL-implementation-specific object describing
2609
+ the connection. Returns NULL if the connection is not encrypted
2610
+ or the requested type of object is not available from the connection's
2611
+ SSL implementation.
2605
2612
<synopsis>
2606
2613
void *PQsslStruct(const PGconn *conn, const char *struct_name);
2607
2614
</synopsis>
2608
2615
</para>
2609
2616
<para>
2610
2617
The struct(s) available depend on the SSL implementation in use.
2611
2618
For <productname>OpenSSL</productname>, there is one struct,
2612
- available under the name "OpenSSL", and it returns a pointer to the
2613
- <productname>OpenSSL</productname> <literal>SSL</literal> struct.
2619
+ available under the name <literal>OpenSSL</literal>,
2620
+ and it returns a pointer to
2621
+ <productname>OpenSSL</productname>'s <literal>SSL</literal> struct.
2614
2622
To use this function, code along the following lines could be used:
2615
2623
<programlisting><![CDATA[
2616
2624
#include <libpq-fe.h>
@@ -2643,7 +2651,7 @@ void *PQsslStruct(const PGconn *conn, const char *struct_name);
2643
2651
<listitem>
2644
2652
<para>
2645
2653
<indexterm><primary>SSL</primary><secondary sortas="libpq">in libpq</secondary></indexterm>
2646
- Returns the SSL structure used in the connection, or null
2654
+ Returns the SSL structure used in the connection, or NULL
2647
2655
if SSL is not in use.
2648
2656
2649
2657
<synopsis>
0 commit comments