pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Donald Fraser <postgres@kiwi-fraser.net>
To: [ADMIN] <pgsql-admin@postgresql.org>
Subject: Re: Beginning SSL Questions
Date: Thu, 14 Sep 2006 16:16:50 +0100
Message-ID: <003201c6d810$cdccb860$6464a8c0@DonAcer> (raw)
References: <009801c6d808$7200a260$6700a8c0@geier>

Jeanna Geier Wrote:

> - In the docs, it says that when using SSL in Postgres "This requires that
> OpenSSL is installed on both client and server systems and that support in
> PostgreSQL is enabled at build time" - is this correct?  Or can we use the
> certificates and keystore file we generated using the Jave keytool
> implementing SSL with Tomcat?


OpenSSL must be installed on the server and enabled at build time.
OpenSSL does not have to be installed on the client.

You are advised to use the OpenSSL tools to create the private/public key pair
for the server as it will then be in the correct format. Assuming you know how
to build/acquire a signed certificate that requires no parse phrase, place the
certificate pair into the root data directory of PostgreSQL. The key pair
should be named server.key and server.crt respectively. Make sure the
permissions on these files are only readable by the postgres user account that
runs the database.

The line ssl=true must appear in the postgresql.conf file.

A restart of the server will be required for ssl to be enabled.

Now for the Java side of things.

If your certificate was signed by a recognised authority you will need a copy
of the public certificate used by the authority that signed your certificate.
Place that public certificate into the Java key store. Most of the well known
ones are already provided in the key store for Sun's VM.

If you self signed the certificate on the server then simply place the public
part of the key pair (server.crt) into your Java key store.

The above will enable clients to connect using ssl.
If you require client authenticaton using ssl then you will need the public key
used to sign your client side certificates. You will need to place the public
key into the root data directory of PostgreSQL and it must be named root.crt.

User the pg_hba.conf file to force clients to use ssl or not.

Hope that helps.
Regards
Donald Fraser





view thread (7+ messages)  latest in thread

Message-ID: <003201c6d810$cdccb860$6464a8c0@DonAcer>
Permalink:  ../003201c6d810$cdccb860$6464a8c0@DonAcer/
Also on:    postgresql.org/message-id/003201c6d810$cdccb860$6464a8c0@DonAcer

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: postgres@kiwi-fraser.net
  Subject: Re: Beginning SSL Questions
  In-Reply-To: <003201c6d810$cdccb860$6464a8c0@DonAcer>
  References: <009801c6d808$7200a260$6700a8c0@geier> <003201c6d810$cdccb860$6464a8c0@DonAcer>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox