The following shows the procedure to enable SSL of PostgreSQL.
Installation of a private key and self-signed certificate
Copy both the private key (server.key) and the self-singed certificate (server.crt) to the <PostgreSQL installed directory>/data
Open postgresql.conf ( found in the <PostgreSQL installed directory>/data) with text editor and enable SSL by setting ssl=on.
By editing pg_hba.conf ( found in the <PostgreSQL installed directory>/data), SSL can be enforced.
For any details, refer to PostgreSQL 9.4 Documentation - 19.1.The pg_hba.conf File (http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html)