File tree 1 file changed +24
-5
lines changed
1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -1864,7 +1864,7 @@ int PQconnectionUsedPassword(const PGconn *conn);
1864
1864
if SSL is not in use.
1865
1865
1866
1866
<synopsis>
1867
- SSL *PQgetssl(const PGconn *conn);
1867
+ void *PQgetssl(const PGconn *conn);
1868
1868
</synopsis>
1869
1869
</para>
1870
1870
@@ -1875,10 +1875,29 @@ SSL *PQgetssl(const PGconn *conn);
1875
1875
</para>
1876
1876
1877
1877
<para>
1878
- You must define <symbol>USE_SSL</symbol> in order to get the
1879
- correct prototype for this function. Doing so will also
1880
- automatically include <filename>ssl.h</filename> from
1881
- <productname>OpenSSL</productname>.
1878
+ The actual return value is of type <type>SSL *</type>,
1879
+ where <type>SSL</type> is a type defined by
1880
+ the <productname>OpenSSL</productname> library, but it is not declared
1881
+ this way to avoid requiring the <productname>OpenSSL</productname>
1882
+ header files. To use this function, code along the following lines
1883
+ could be used:
1884
+ <programlisting><![CDATA[
1885
+ #include <libpq-fe.h>
1886
+ #include <openssl/ssl.h>
1887
+
1888
+ ...
1889
+
1890
+ SSL *ssl;
1891
+
1892
+ dbconn = PQconnectdb(...);
1893
+ ...
1894
+
1895
+ ssl = PQgetssl(dbconn);
1896
+ if (ssl)
1897
+ {
1898
+ /* use OpenSSL functions to access ssl */
1899
+ }
1900
+ ]]></programlisting>
1882
1901
</para>
1883
1902
</listitem>
1884
1903
</varlistentry>
You can’t perform that action at this time.
0 commit comments