It may be one of the most important requirements to enable encryption of communication between the client and the server when dealing with critical financial databases and also to satisfy certain compliances. PostgreSQL satisfies this requirement by allowing connections to use SSL. In this recipe, we shall discuss the steps involved in setting up the encryption of data moving over the wire.
Getting ready
In order to enable SSL, we must have the server and client certification files that are signed by a Certification Authority (CA). This is usually performed by the security teams in most organizations. Admins could use OpenSSL to generate the certificates. Once they are created, we should set the following parameters in PostgreSQL:
- ssl_ca_file: Specifies the name of the file containing the SSL server CA
- ssl_cert_file: Specifies the name of the file containing the SSL server certificate
- ssl_key_file: Specifies the name of the file...