postgresql_16:5.1.19.5 SSL Library Initialization
PostgreSQL 16 > Client Interfaces > libpq — C Library > SSL Support > SSL Library Initialization
If your application initializes libssl and/or libcrypto libraries and libpq is built with SSL support, you should call (see libpq-PQinitOpenSSL) to tell libpq that the libssl and/or libcrypto libraries have been initialized by your application, so that libpq will not also initialize those libraries. However, this is unnecessary when using OpenSSL version 1.1.0 or later, as duplicate initializations are no longer problematic.
PQinitOpenSSL Allows applications to select which security libraries to initialize. void PQinitOpenSSL(int do_ssl, int do_crypto); When do_ssl is non-zero, libpq will initialize the OpenSSL library before first opening a database connection. When do_crypto is non-zero, the libcrypto library will be initialized. By default (if (see libpq-PQinitOpenSSL) is not called), both libraries are initialized. When SSL support is not compiled in, this function is present but does nothing. If your application uses and initializes either OpenSSL or its underlying libcrypto library, you *must* call this function with zeroes for the appropriate parameter(s) before first opening a database connection. Also be sure that you have done that initialization before opening a database connection. PQinitSSL Allows applications to select which security libraries to initialize. void PQinitSSL(int do_ssl); This function is equivalent to PQinitOpenSSL(do_ssl, do_ssl). It is sufficient for applications that initialize both or neither of OpenSSL and libcrypto. (see libpq-PQinitSSL) has been present since PostgreSQL 8.0, while (see libpq-PQinitOpenSSL) was added in PostgreSQL 8.4, so (see libpq-PQinitSSL) might be preferable for applications that need to work with older versions of libpq.