pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Magosányi Árpád <mag@magwas.rulez.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Trouble setting up ssl cert authentication from java/hibernate
Date: Thu, 03 Nov 2011 17:12:13 +0800
Message-ID: <4EB25AED.3030109@ringerc.id.au> (raw)
In-Reply-To: <4EB1498A.4080400@magwas.rulez.org>
References: <4EB1498A.4080400@magwas.rulez.org>

On 11/02/2011 09:45 PM, Magosányi Árpád wrote:


> The juice of my test case:
> String password = new PasswordDialog(new Shell()).ask();
> System.out.println("keystore
> path="+System.getProperty("javax.net.ssl.trustStore"));
> File keystorepath = new File(System.getProperty("user.home"),".keystore");
> System.setProperty("javax.net.ssl.trustStore",keystorepath.getAbsolutePath());

You must set the javax.net.ssl system properties before *any* SSL code 
is run. They're read once and after that changes to them are ignored.

If you set them on the java command line instead of in code, does it use 
the certificate and key you provide then?

BTW, I'd also like to see the cert auth factory integrated into PgJDBC. 
It's seen some testing, and the best way to get that kind of code tested 
more broadly is get it into use.

--
Craig Ringer



view thread (5+ messages)

Message-ID: <4EB25AED.3030109@ringerc.id.au>
Permalink:  ../4EB25AED.3030109@ringerc.id.au/
Also on:    postgresql.org/message-id/4EB25AED.3030109@ringerc.id.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: ringerc@ringerc.id.au, mag@magwas.rulez.org
  Subject: Re: Trouble setting up ssl cert authentication from java/hibernate
  In-Reply-To: <4EB25AED.3030109@ringerc.id.au>
  References: <4EB1498A.4080400@magwas.rulez.org> <4EB25AED.3030109@ringerc.id.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