Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9p0K-0006wg-Rd for pgsql-general@arkaria.postgresql.org; Mon, 25 Feb 2013 03:45:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U9p0K-0007tw-7G for pgsql-general@arkaria.postgresql.org; Mon, 25 Feb 2013 03:45:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9p0I-0007tq-Nk for pgsql-general@postgresql.org; Mon, 25 Feb 2013 03:45:26 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U9p0E-0002GH-LX for pgsql-general@postgresql.org; Mon, 25 Feb 2013 03:45:26 +0000 Received: by mail-pa0-f52.google.com with SMTP id fb1so1488316pad.11 for ; Sun, 24 Feb 2013 19:45:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9krdYpbWHEE4to5gSUM0A4GyEGLrd1JPU2BUPRT0kTM=; b=yB1hNC1LvzRWttAaJFPXnxiECTY+NCol5hTChIKsYx3rnBkOsrvzYVdth3uoP+4vgQ IFt3NMfQQAx+z3ZZvOaQhLf5UwD8G773iAgwTWYGOH2RSmuvhVYDcYXyaz5fa4tkx2WK rerpGhVjzsie5bNwA/4f9xttTO2j9iktoZmfCxhY1+avWCyiwSfMdOtOHdrfuit3NDpL XQCtqD74iwi43C9m/RcYN9POl5/zdMnjGQIj6cjW1PB/YJQVgQM1DD8V2OmhE3s1buQl lIaEULNC6/POn2bOIA43r8krmC7plVMm9+qKW607/IL5xu2OWTg0NByffcbTH1OLT+kQ sHfA== X-Received: by 10.66.155.226 with SMTP id vz2mr16845554pab.90.1361763920828; Sun, 24 Feb 2013 19:45:20 -0800 (PST) Received: from [192.168.0.5] (c-24-17-164-54.hsd1.wa.comcast.net. [24.17.164.54]) by mx.google.com with ESMTPS id iu10sm11164454pbc.13.2013.02.24.19.45.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Feb 2013 19:45:20 -0800 (PST) Message-ID: <512ADE4E.4020409@gmail.com> Date: Sun, 24 Feb 2013 19:45:18 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Maz Mohammadi CC: "pgsql-general@postgresql.org" Subject: Re: [JDBC] can't access through SSL References: <9F992F0A0D9BA04F914597F75435942D09576C4E84@MBX36.exg5.exghost.com> <9F992F0A0D9BA04F914597F75435942D09576C4FDD@MBX36.exg5.exghost.com> <9F992F0A0D9BA04F914597F75435942D09576C50C8@MBX36.exg5.exghost.com> <512A87F5.4020104@gmail.com> <9F992F0A0D9BA04F914597F75435942D09576C50ED@MBX36.exg5.exghost.com> <512AB962.6040107@gmail.com> <9F992F0A0D9BA04F914597F75435942D09576C50FB@MBX36.exg5.exghost.com> In-Reply-To: <9F992F0A0D9BA04F914597F75435942D09576C50FB@MBX36.exg5.exghost.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 02/24/2013 05:54 PM, Maz Mohammadi wrote: > Hi Adrian, > > Thanks for sharing some pointers with me. You are right, it's not actually an JDBC driver issue. I posted it on jdbc, because I'm accessing it from a jdbc client, I thought there might be some security issues with the JDBC driver. > > 1) I'm running postgres-xc v. 9.1. I'm "pretty" sure that my postgres setup is correct. Another person from this distribution list help me a bit. This test shows me that the ssl is setup correctly on my server... Which server? As I understand it Postgres-XC can have multiple clusters in use, so I am still not sure which one you are connecting to? > > ---------- > postgres-xc@adminuser-VirtualBox:~/datanode2$ psql > psql (PGXC 1.0.0, based on PG 9.1.4) > Type "help" for help. > > postgres=# \q > postgres-xc@adminuser-VirtualBox:~/datanode2$ psql -h localhost To make things easier to debug, use explicit options. The above command leaves a lot to env variables and hidden configuration. There is a good chance you are not connecting the way you think you are. > psql: FATAL: connection requires a valid client certificate > FATAL: no pg_hba.conf entry for host "127.0.0.1", user "postgres-xc", database "postgres", SSL off > postgres-xc@adminuser-VirtualBox:~/datanode2$ At this point do none of the Tomcat/JDBC process . Until you solve the above, it just gets you to the same error and it confuses the issue. The first thing to solve is why you are getting two different error messages, in particular why it says SSL is off. The second is whether the user and database specified in the error are who are trying to connect as and the database you are trying to connect to. Also have you gone through Table 17-3. SSL Server File Usage at link below to see if everything is in place: http://www.postgresql.org/docs/9.2/interactive/ssl-tcp.html Have you followed Rays suggestion: 'I use openssl to verify the chain, I think that would help you know what's going on: openssl verify -CAfile rootca.crt user.crt > ------------ > > 2) My client is a tomcat server. I've placed JDBC3 drivers (jar file) in the WEB-INF lib directory of my webapp. > > 3) MY jdbc url is "jdbc:postgresql://localhost:5432:testdb?ssl=true", and believe me.... username and password are correct. > > 4) Both postgres and tomcat are running on the same machine (an Ubuntu linux virtual box). > > 5) when I try to create a JDBC datasource on my tomcat, I enter the JDBC url + user + password, and I'm expecting it to be able to connect to it and at least get a "test successful" but I don't. I get the error that I sent... > "Connection attempt failed: FATAL: connection requires a valid client certificate" > > 6) I've also specified the following java options.. > -Djavax.net.ssl.trustStore=/home/adminuser/pentaho/keycerts/mazstore -Djavax.net.ssl.trustStorePassword=password > > I'll post this on the other distribution list. BTW, I don't see much in the log files under /var/log directory. > > -maz > -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general