Bug (?) in JDB

From: Calum <caluml(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Bug (?) in JDB
Date: 2008-01-21 14:00:34
Message-ID: 635498b70801210600j7f35257fl16f65ceccae21388@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Hello all,

I've noticed that when using Java and postgres-jdbc, setting ssl=false
in Properties doesn't get read, and ssl=false and ssl=true both cause
SSL to be tried.

E.g:

String url = "jdbc:postgresql://"+host+"/"+database;
Properties props = new Properties();
props.setProperty("user", "blah");
props.setProperty("password", "blah");
props.setProperty("ssl", "false");
props.setProperty("sslfactory",
"org.postgresql.ssl.NonValidatingFactory");
Connection conn = null;
conn = DriverManager.getConnection(url, props);

causes it to throw: org.postgresql.util.PSQLException: The server does
not support SSL. (even though I've said not to try SSL).

String url = "jdbc:postgresql://"+host+"/"+database;
Properties props = new Properties();
props.setProperty("user", "blah");
props.setProperty("password", "blah");
// Don't even set these ones below, as they seem to make it
try SSL regardless.
// props.setProperty("ssl", "false");
// props.setProperty("sslfactory",
"org.postgresql.ssl.NonValidatingFactory");
Connection conn = null;
conn = DriverManager.getConnection(url, props);

works fine.

Problem exists both with postgresql-8.2-505.jdbc3.jar and
postgresql-8.2-507.jdbc3.jar

C

--
bash# Got root? Get root. Fast Linux VPS
http://linuxvps.org/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Russ Brown 2008-01-21 14:01:49 Re: Sun acquires MySQL
Previous Message Merlin Moncure 2008-01-21 13:45:47 Re: Sun acquires MySQL

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2008-01-21 22:23:30 Re: [JDBC] Bug (?) in JDB
Previous Message 郭朝益 (ChaoYi, Kuo.) 2008-01-21 08:56:31 Update zh_TW translation po file. (73%)