Encrypting the communication data requires the same setup as using the C library (libpq).
For information about setting up the environment in the C library, refer to "5.2.3 Settings for Encrypting Communication Data" in the "C Library (libpq)".