Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 8DC3515B6234 for ; Sun, 4 Dec 2011 13:15:30 -0400 (AST) Received: from lo.gmane.org ([80.91.229.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RXFex-0001bh-PJ for pgsql-jdbc@postgresql.org; Sun, 04 Dec 2011 17:15:29 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RXFeh-00023F-Qq for pgsql-jdbc@postgresql.org; Sun, 04 Dec 2011 18:15:11 +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 ; Sun, 04 Dec 2011 18:15:11 +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 ; Sun, 04 Dec 2011 18:15:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Walter Hurry Subject: JDBC with SSL Date: Sun, 4 Dec 2011 16:40:47 +0000 (UTC) Lines: 31 Message-ID: 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/10 X-Sequence-Number: 22464 First of all, I am sorry if this is the wrong place to ask. If it is, perhaps someone could direct me to the right arena. This is PostgreSQL 9.0.1 with PostgreSQL JDBC 9.1.901. I have successfully set up one of my databases to require SSL connections with a certificate, and installed a certificate into $HOME/.postgresql. That directory contains postgresql.crt, postgresql.key and root.crt. I can connect successfully using psql and libpq applications. The connection is also rejected properly if I move the certificate out of the way. Now I am trying to connect using JDBC and SSL from a Java application (JDBC is fine without SSL on another database). However, I am getting the following error: FATAL: connection requires a valid client certificate So it appears that somehow I need to "tell" Java where to find the client certificate. Any pointers as to how I do this please? By the way, since this is a self-signed certificate I have followed the instructions at . These succeeded, but I am still getting the error. Thanks, Walter