To understand more about SSL in general, and the OpenSSL library used by PostgreSQL in particular, visit http://www.openssl.org, or get a good book about SSL.
To get started with the generation of simple SSL keys and certificates, see https://github.com/openssl/openssl/blob/master/doc/HOWTO/certificates.txt.
There is also a nice presentation named Encrypted PostgreSQL explaining these issues at PGCon 2009. The slides are available at http://www.pgcon.org/2009/schedule/events/120.en.html.