Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 933081337B83 for ; Sat, 5 Feb 2011 04:58:42 -0400 (AST) 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 15879-08 for ; Sat, 5 Feb 2011 08:58:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id 10603133616B for ; Sat, 5 Feb 2011 04:58:34 -0400 (AST) Received: from radek.localnet (87-204-194-135.dg-net.pl [87.204.194.135]) by mail.softperience.eu (Postfix) with ESMTPA id 9CDCDC000CD; Sat, 5 Feb 2011 09:58:35 +0100 (CET) To: pgsql-jdbc@postgresql.org Subject: Re: ssl connection strangely stops working Cc: zhong ming wu From: =?utf-8?q?Rados=C5=82aw_Smogura?= Date: Sat, 5 Feb 2011 09:58:37 +0100 MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201102050958.37104.rsmogura@softperience.eu> 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: 201102/21 X-Sequence-Number: 21419 I don't think JDBC driver use custom SSL "validators" including host name a= nd=20 certificate chains, if you don't specify one with socket factory. It lies o= n=20 this what is available in JVM. It's looks like in this way Sun SSL sockets= =20 works. May I ask what GF version do you use and did you specified trustore passwor= ds =20 configuration in -D propperties?=20 I actually use GF and I was in need to configure truststores per JVM level = (- D) to use SSL sockets in (v3.1 releases). I don't like this soulution as it= =20 require to provide clear text master password. Kind regards, Rados=C5=82aw Smogura http://softperience.eu zhong ming wu Saturday 05 February 2011 03:50:37 > the problem was traced to server certificate expiration >=20 > the problematic server cert is signed by a commercial CA. i think > problem is caused by jdbc not connecting to expired certificate >=20 > however jdbc had not been checking that hostname is the same as CN ; > so i had assumed that i does no other checking. >=20 > since psql was working it confused me even more. replacing with > unexpired commercial certificate fixes the problem although this new > cert CN does match the hostname. >=20 > jdbc also does not like unexpired server cert signed by the company CA. >=20 > good to learn something new. >=20 > very sorry about the noise. >=20 > On Fri, Feb 4, 2011 at 8:48 PM, zhong ming wu wrote: > > Dear List > >=20 > > I am not a very experienced user of jdbc although have been using > > postgresql for many years having done many server installation and > > administering them. > >=20 > > From three different systems (mac, windows, and centos virtualbox) > > behind 1 ip address I had succeeded in getting ssl connection to a > > remote server via jdbc. (That after much struggle on centOS > > glassfish; turns out i had to run > > "asadmin set > > domain.resources.jdbc-connection-pool.connectionPool.property.JDBC30Data > > Source=3Dtrue" at glassfish account) > >=20 > > On mac and windows the connection is set up via netbeans/glassfish. > > All were working very well for about two weeks up until yesterday > > evening. > >=20 > > Today all three connections stop working for no apparent reason. I > > had not touched any settings on the postgresql server. > >=20 > > In server log I only get this, > >=20 > > LOG: could not accept SSL connection: sslv3 alert certificate unknown > >=20 > > Yes I googled this problem and find pages seemingly not relevant to my > > problem. I know I have ssl connection right because it was working > > just 24 hours ago with no changes in server or client settings. > >=20 > > Even weirder I can still connect to this server using psql from centOS > > virtualbox. See this > > ------------------ > > /usr/local/pg/bin/psql -U mail -h server.address -p 5433 mail > > Password for user mail: > > psql (9.0.2) > > SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256) > > Type "help" for help. > >=20 > > mail=3D> > > ----------- > >=20 > > Any suggestions? Do I suddenly need to enter server ssl cert into > > keystore of glassfish server now? But I didn't need it before! > >=20 > > Some webpages mention using property > > sslfactory=3Dorg.postgresql.ssl.NonValidatingFactory > >=20 > > That does not seem to help much. > >=20 > > Thanks > >=20 > > mr wu