By default, the localhost connections to the PostgreSQL database do not use TLS. To enable TLS, you have to either generate a self-signed certificate with OpenSSL or provide your own certificate.

To enable TLS on localhost connections to PostgreSQL, complete the following steps:

1

Generate or Provide Your Own Self-Signed Certificate with OpenSSL

2

Install the Certificate for PostgreSQL

3

Enable TLS on PostgreSQL