Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 117CE632968 for ; Fri, 24 Jul 2009 12:22:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 84665-01 for ; Fri, 24 Jul 2009 15:22:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 4A689632F00 for ; Fri, 24 Jul 2009 12:22:34 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id 2D50BA2D1; Fri, 24 Jul 2009 11:22:33 -0400 (EDT) Date: Fri, 24 Jul 2009 11:22:32 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: nmset@netcourrier.com cc: pgsql-jdbc@postgresql.org Subject: Re: SSL - NonValidatingFactory In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.025 tagged_above=-10 required=5 tests=AWL=0.025 X-Spam-Level: X-Archive-Number: 200907/59 X-Sequence-Number: 19827 On Fri, 24 Jul 2009, nmset@netcourrier.com wrote: > I am having problems making SSL connection to PostgreSQL 8.3.7 with the > jdbc driver, when using the NonValidatingFactory. The server constantly > rejects the connection saying there is no certificate presented. > > There is no problem when NonValidatingFactory is not in use, and a > keystore + truststore are used by the usual mechanism (-Djavax.ssl...). > > According to the PostgreSQl server documentation, if a root.crt > cerfificate is present in the data directory of the database cluster, > the server requires that a client certificate must be verified. > > The NonValidatingFactory is supposed to bypass any credentials > presentation to the server. The NonValidatingFactory does not verify the information presented by the server. It cannot convince the server to avoid verifying the client certificate. If the server is configured to require a client cert, it wouldn't make a lot of sense to allow a client to turn off that verification. The documentation was written at a time when we didn't think client certificate presentation worked, so it didn't really consider that possibility. So if you really want encryption only and no validation, you need to turn off the client certificate requirement on the server end. Kris Jurka