pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC connection test with SSL on PG 9.2.1 server
Date: Tue, 29 Jan 2013 09:56:07 -0700
Message-ID: <5107FF27.701@ttc-cmc.net> (raw)
In-Reply-To: <00a401cdfdde$db9737e0$92c5a7a0$@kommi@huawei.com>
References: <51068542.845c2b0a.7fd0.68b2SMTPIN_ADDED_BROKEN@mx.google.com>
	<CADK3HHLO-eup0et0nh85sZ=urfhsa=pqqGr8xJ+GpRZGBAC9+A@mail.gmail.com>
	<00a401cdfdde$db9737e0$92c5a7a0$@kommi@huawei.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hello Hari,

Can you please set the property logLevel=1, INFO
and then reply back with the output. You may also
try logLevel=2, 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 <haribabu.kommi@huawei.com
> <mailto:haribabu.kommi@huawei.com>> 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:
>  >>
>  >>url = "jdbc:postgresql://" + "10.145.98.227" + ':'
>  >> + "8707" + '/'
>  >> + "POSTGRES";
>  >> Properties props = 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 = 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 = 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.



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (10+ messages)  latest in thread

Message-ID: <5107FF27.701@ttc-cmc.net>
Permalink:  ../5107FF27.701@ttc-cmc.net/
Also on:    postgresql.org/message-id/5107FF27.701@ttc-cmc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: danap@ttc-cmc.net
  Subject: Re: JDBC connection test with SSL on PG 9.2.1 server
  In-Reply-To: <5107FF27.701@ttc-cmc.net>
  References: <51068542.845c2b0a.7fd0.68b2SMTPIN_ADDED_BROKEN@mx.google.com> <CADK3HHLO-eup0et0nh85sZ=urfhsa=pqqGr8xJ+GpRZGBAC9+A@mail.gmail.com> <00a401cdfdde$db9737e0$92c5a7a0$@kommi@huawei.com> <5107FF27.701@ttc-cmc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox