Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 98347B5DCC2 for ; Thu, 3 Nov 2011 08:03:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 05081-05 for ; Thu, 3 Nov 2011 11:03:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 71D49B5DED3 for ; Thu, 3 Nov 2011 08:02:39 -0300 (ADT) Received: by vws1 with SMTP id 1so710311vws.19 for ; Thu, 03 Nov 2011 04:02:38 -0700 (PDT) Received: by 10.52.37.10 with SMTP id u10mr8654375vdj.57.1320311559640; Thu, 03 Nov 2011 02:12:39 -0700 (PDT) Received: from ayaki.localdomain (58-7-142-223.dyn.iinet.net.au. [58.7.142.223]) by mx.google.com with ESMTPS id c7sm7089641vdh.12.2011.11.03.02.12.37 (version=SSLv3 cipher=OTHER); Thu, 03 Nov 2011 02:12:39 -0700 (PDT) Message-ID: <4EB25AED.3030109@ringerc.id.au> Date: Thu, 03 Nov 2011 17:12:13 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: =?UTF-8?B?TWFnb3PDoW55aSDDgXJww6Fk?= CC: pgsql-jdbc@postgresql.org Subject: Re: Trouble setting up ssl cert authentication from java/hibernate References: <4EB1498A.4080400@magwas.rulez.org> In-Reply-To: <4EB1498A.4080400@magwas.rulez.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/5 X-Sequence-Number: 22340 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