Commit b9bdaf39 authored by Peter Eisentraut's avatar Peter Eisentraut

doc: Update PQgetssl() documentation

The return type of PQgetssl() was changed from SSL* to void* a long time
ago, but the documentation was not updated.
parent d61dddba
...@@ -1864,7 +1864,7 @@ int PQconnectionUsedPassword(const PGconn *conn); ...@@ -1864,7 +1864,7 @@ int PQconnectionUsedPassword(const PGconn *conn);
if SSL is not in use. if SSL is not in use.
<synopsis> <synopsis>
SSL *PQgetssl(const PGconn *conn); void *PQgetssl(const PGconn *conn);
</synopsis> </synopsis>
</para> </para>
...@@ -1875,10 +1875,29 @@ SSL *PQgetssl(const PGconn *conn); ...@@ -1875,10 +1875,29 @@ SSL *PQgetssl(const PGconn *conn);
</para> </para>
<para> <para>
You must define <symbol>USE_SSL</symbol> in order to get the The actual return value is of type <type>SSL *</type>,
correct prototype for this function. Doing so will also where <type>SSL</type> is a type defined by
automatically include <filename>ssl.h</filename> from the <productname>OpenSSL</productname> library, but it is not declared
<productname>OpenSSL</productname>. this way to avoid requiring the <productname>OpenSSL</productname>
header files. To use this function, code along the following lines
could be used:
<programlisting><![CDATA[
#include <libpq-fe.h>
#include <openssl/ssl.h>
...
SSL *ssl;
dbconn = PQconnectdb(...);
...
ssl = PQgetssl(dbconn);
if (ssl)
{
/* use OpenSSL functions to access ssl */
}
]]></programlisting>
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment