Re: Trouble setting up ssl cert authentication from java/hibernate - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: Trouble setting up ssl cert authentication from java/hibernate
Date
Msg-id 4EB25AED.3030109@ringerc.id.au
Whole thread Raw
In response to Trouble setting up ssl cert authentication from java/hibernate  (Magosányi Árpád <mag@magwas.rulez.org>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: "magwas@rabic.org"
Date:
Subject: Re: Trouble setting up ssl cert authentication from java/hibernate
Next
From: "Johann 'Myrkraverk' Oskarsson"
Date:
Subject: Re: Fwd: [BUGS] BUG #6285: PreparedStatement#executeUpdate gets syntax error on apostrophe