Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 1B44219CDE13 for ; Mon, 5 Dec 2011 14:47:16 -0400 (AST) Received: from lo.gmane.org ([80.91.229.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RXdZH-0006bA-Az for pgsql-jdbc@postgresql.org; Mon, 05 Dec 2011 18:47:16 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RXdZ4-00052M-L9 for pgsql-jdbc@postgresql.org; Mon, 05 Dec 2011 19:46:58 +0100 Received: from cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com ([86.21.186.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Dec 2011 19:46:58 +0100 Received: from walterhurry by cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Dec 2011 19:46:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Walter Hurry Subject: Re: JDBC with SSL Date: Mon, 5 Dec 2011 18:46:42 +0000 (UTC) Lines: 30 Message-ID: References: <4EDC1031.2010607@ringerc.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc3-walt15-2-0-cust148.13-2.cable.virginmedia.com User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) X-Pg-Spam-Score: -5.4 (-----) X-Archive-Number: 201112/15 X-Sequence-Number: 22469 On Mon, 05 Dec 2011 08:28:33 +0800, Craig Ringer wrote: > You don't need the SecurityManager enabled. You need the java.net.ssl > properties for keyStore, keyStorePassword and keyStoreType set to point > to your JECKS keystore, and need trustStore, trustStorePassword and > trustStoreType set to point to the keystore you imported the database's > certificate into, which is probably the same store in your case. Thanks for the guidance, Craig. I'm trying to use javax.net.ssl but I'm still stuck. Sample below: ------------------------------------------------------------- $ java -Djavax.net.ssl.keyStore=$HOME/.postgresql/clientstore \ -Djavax.net.ssl.keyStorePassword=changeit \ -Djavax.net.ssl.keyStoreType="jks" \ -Djavax.net.ssl.trustStore=$JAVA_HOME/lib/security/cacerts \ -Djavax.net.ssl.trustStorePassword=changeit \ -Djavax.net.ssl.trustStoreType="jks" \ JDBCExample neptune misc -------- PostgreSQL JDBC Connection Testing ------------ PostgreSQL JDBC driver registered Getting connection to jdbc:postgresql://neptune/misc Connect failed: FATAL: connection requires a valid client certificate ------------------------------------------------------------- Any idea what I am doing wrong? Thanks.