The return type of PQgetssl() was changed from SSL* to void* a long time
ago, but the documentation was not updated.
if SSL is not in use.
-SSL *PQgetssl(const PGconn *conn);
+void *PQgetssl(const PGconn *conn);
- You must define USE_SSL in order to get the
- correct prototype for this function. Doing so will also
- automatically include ssl.h from
+ The actual return value is of type SSL *,
+ where SSL is a type defined by
+ the
OpenSSL library, but it is not declared
+ this way to avoid requiring the
OpenSSL
+ header files. To use this function, code along the following lines
+ could be used:
+
+#include
+#include
+
+...
+
+ SSL *ssl;
+
+ dbconn = PQconnectdb(...);
+ ...
+
+ ssl = PQgetssl(dbconn);
+ if (ssl)
+ {
+ /* use OpenSSL functions to access ssl */
+ }
+]]>