pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Jeffrey Baker <jwbaker@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC SSL with postgresql
Date: Thu, 03 Jun 2010 13:50:10 +0800
Message-ID: <4C074292.8010208@postnewspapers.com.au> (raw)
In-Reply-To: <AANLkTilbzeXwef87Z9xv6OqTy3gtUjAWhLrBs9U0IKPe@mail.gmail.com>
References: <AANLkTikptvIa8hE5J_9lzqIwZYuQ7AMHLQIiZh8uAFEn@mail.gmail.com>
	<4C0712E6.1050002@postnewspapers.com.au>
	<AANLkTilbzeXwef87Z9xv6OqTy3gtUjAWhLrBs9U0IKPe@mail.gmail.com>

On 3/06/2010 11:06 AM, Jeffrey Baker wrote:

> Thanks for the info.
>
> I have complete control of both ends, and both the server and client
> are signed by my self-signed root cert.  I think perhaps the problem
> here is that I'm trying to tackle the entire Java SSL infrastructure
> in one go; I knew nothing about it this morning.  I read somewhere
> that the keystore has to include both the client cert and the root
> cert that signed it.  Is that not true?

No, it's not strictly true, but it's a good idea. However, "include" is 
pretty broad.

When you get a reply from your certificate authority containing the 
signed certificate, it should include the full certificate chain in that 
reply. If it doesn't, you should append the CA cert and any other 
intermediate certs to the reply before importing it with keytool.

So, when you use keytool to list your keystore, you should only see one 
entry (alias). The certificate part of that entry should preferably 
include the full certificate chain up to the CA certificate, though.

Your truststore should contain only trustedCertificate aliases for the 
CA certs you trust to identify peers.

>  I've tried it both ways:
> added root cert, then added client cert (this is the way it's
> documented in the keytool manual page, the way I interpret it), and
> only adding the client cert to the keystore.  It doesn't seem to work
> either way.

Concatenate all certs in the chain into one file, and import that.

--
Craig Ringer



view thread (7+ messages)  latest in thread

Message-ID: <4C074292.8010208@postnewspapers.com.au>
Permalink:  ../4C074292.8010208@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4C074292.8010208@postnewspapers.com.au

 · 

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-jdbc@postgresql.org
  Cc: craig@postnewspapers.com.au, jwbaker@gmail.com
  Subject: Re: JDBC SSL with postgresql
  In-Reply-To: <4C074292.8010208@postnewspapers.com.au>
  References: <AANLkTikptvIa8hE5J_9lzqIwZYuQ7AMHLQIiZh8uAFEn@mail.gmail.com> <4C0712E6.1050002@postnewspapers.com.au> <AANLkTilbzeXwef87Z9xv6OqTy3gtUjAWhLrBs9U0IKPe@mail.gmail.com> <4C074292.8010208@postnewspapers.com.au>

* 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