Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0EUy-00027H-Ky for pgsql-jdbc@arkaria.postgresql.org; Tue, 29 Jan 2013 16:57:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U0EUx-0002jL-Ql for pgsql-jdbc@arkaria.postgresql.org; Tue, 29 Jan 2013 16:57:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0EUx-0002il-8e for pgsql-jdbc@postgresql.org; Tue, 29 Jan 2013 16:57:27 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0EUu-0005Uv-WF for pgsql-jdbc@postgresql.org; Tue, 29 Jan 2013 16:57:26 +0000 Received: from [192.168.157.132] (unknown [76.75.27.41]) by outbound.vnet-inc.com (Postfix) with ESMTP id 54FF25A85 for ; Tue, 29 Jan 2013 09:57:24 -0700 (MST) Message-ID: <5107FF27.701@ttc-cmc.net> Date: Tue, 29 Jan 2013 09:56:07 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: JDBC connection test with SSL on PG 9.2.1 server References: <51068542.845c2b0a.7fd0.68b2SMTPIN_ADDED_BROKEN@mx.google.com> <00a401cdfdde$db9737e0$92c5a7a0$@kommi@huawei.com> In-Reply-To: <00a401cdfdde$db9737e0$92c5a7a0$@kommi@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hello Hari, Can you please set the property logLevel=3D1, INFO and then reply back with the output. You may also try logLevel=3D2, DEBUG for additional information. danap. Hari Babu wrote: > On Monday, January 28, 2013 10:20 PM, Dave Cramer wrote: > > >>On Mon, Jan 28, 2013 at 9:03 AM, Hari Babu > wrote: > > >>While testing PostgreSQL JDBC java client to connect to the PG 9.2.1 > >>database server using SSL. > >>we got the following behavior. > >> > >>The test steps as below=EF=BC=9A > >> > >>url =3D "jdbc:postgresql://" + "10.145.98.227" + ':' > >> + "8707" + '/' > >> + "POSTGRES"; > >> Properties props =3D new Properties(); > >> props.setProperty("user", "CLIENT"); > >> props.setProperty("password", "1234@QWER"); > >> props.setProperty("ssl", "true"); > >> > >> System.setProperty("javax.net.ssl.trustStore", "193store"); > >> System.setProperty("javax.net.ssl.keyStore", "193client.jks"); > >> System.setProperty("javax.net.ssl.trustStorePassword", "qwerty"); > >> System.setProperty("javax.net.ssl.keyStorePassword", "qwerty"); > >> > >> /*Begin the first ssl connection*/ > >> conn1 =3D DriverManager.getConnection(url, props); > >> System.out.println("Connection1 successful!"); > >> > >> > >> System.setProperty("javax.net.ssl.trustStore", "193store"); > >> System.setProperty("javax.net.ssl.keyStore", "193client.jks"); > >> System.setProperty("javax.net.ssl.trustStorePassword", "qwerty"); > >> System.setProperty("javax.net.ssl.keyStorePassword", "wrongpassword"); > >> > >> /*Begin the second ssl connection*/ > >> conn2 =3D DriverManager.getConnection(url, props); > >> System.out.println("Connection2 successful!"); > >> > >>Before first connection we set > >>"System.setProperty("javax.net.ssl.keyStorePassword", "qwerty");" > qwerty is > >>the right password > >>and before second SSL connection we set > >>"System.setProperty("javax.net.ssl.keyStorePassword", "wrongpassword")= ;" > >>wrongpassword is the wrong password. > >> > >>we expect the first SSL connection will be successful and second failed > >>because of wrong password, but actually we get two successful SSL > >>connections. > >>We found that if the first SSL connections password set right, all the > >>following SSL connections are fine ,even set wrong keystroke password. > >> > >>1. Is this a defect about JDBC? > >>2. Is it SSL behavior to authenticate only once? > >>3. Is it system property behavior can be set only once. > >>4. Is it because of any other problems? > >> > >>please give your suggestions? > > >JDBC uses java's SSL infrastructure, as such I don't think it's a > defect in JDBC. It could be because your truststore >does not require a > password. > > I removed the trustStorePassword setting from the test, still the second > connection is getting success with the wrong > > keyStorePassword. > > Regards, > > Hari babu. --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc