pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
GCJ, SSL Connection Issue
3+ messages / 2 participants
[nested] [flat]

* GCJ, SSL Connection Issue
@ 2005-11-29 21:23  Chad Files <cpfiles@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Chad Files @ 2005-11-29 21:23 UTC (permalink / raw)
  To: pgsql-jdbc

I am having issues connecting to a remote postgres server over SSL
using the GCJ interpreter. I have researched the issue all day and
have not got close to solving it. Any help would be appreciated.

Here is the connection code I am using...

Class.forName("org.postgresql.Driver");
String url = "jdbc:postgresql://server/database";
Properties props = new Properties();
props.setProperty("user","na");
props.setProperty("password","na");
props.setProperty("ssl","true");
Connection conn = DriverManager.getConnection(url, props);

Here is the error message...

Caused by: java.lang.RuntimeException: error instantiating default
socket factory: java.security.NoSuchAlgorithmException: SSLv3

I tried using different sslFactory settings like so...

props.setProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory");

I also used the javax.net.ssl.SSLServerSocketFactory class in the
jessie package. With both of these classes I get the error...

The SSLSocketFactory class provided
org.postgresql.ssl.NonValidatingFactory could not be instantiated.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: GCJ, SSL Connection Issue
@ 2005-11-30 01:25  Kris Jurka <books@ejurka.com>
  parent: Chad Files <cpfiles@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Kris Jurka @ 2005-11-30 01:25 UTC (permalink / raw)
  To: Chad Files <cpfiles@gmail.com>; +Cc: pgsql-jdbc



On Tue, 29 Nov 2005, Chad Files wrote:

> I am having issues connecting to a remote postgres server over SSL
> using the GCJ interpreter. I have researched the issue all day and
> have not got close to solving it. Any help would be appreciated.
>
> Caused by: java.lang.RuntimeException: error instantiating default
> socket factory: java.security.NoSuchAlgorithmException: SSLv3
>

This is a limitation of gcj, it doesn't come with a SSL provider by 
default.  You'll need jessie: http://www.nongnu.org/jessie/

Kris Jurka



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: GCJ, SSL Connection Issue
@ 2005-11-30 13:45  Chad Files <cpfiles@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Chad Files @ 2005-11-30 13:45 UTC (permalink / raw)
  To: pgsql-jdbc

On 11/29/05, Kris Jurka <books@ejurka.com> wrote:
> This is a limitation of gcj, it doesn't come with a SSL provider by
> default.  You'll need jessie: http://www.nongnu.org/jessie/

I tried using Jessie yesterday with no success. This morning I decided
to read the documentation again to see if I was doing things
correctly. Then I discovered the real issue...The documentation is not
correct for the addProvider method. It should read:

java.security.Security.addProvider(new org.metastatic.jessie.provider.Jessie());

(the provider package is not mentioned in the documentation)

I am sure with the latest version they just moved some classes around.
Anyway I am now able to connect to Postgres remotely over SSL with
GCJ. Here is my connection code encase it is useful for anybody else.

java.security.Security.addProvider(new org.metastatic.jessie.provider.Jessie());

Class.forName("org.postgresql.Driver");
String url = "jdbc:postgresql://server/database";
Properties props = new Properties();
props.setProperty("user","na");
props.setProperty("password","na");
props.setProperty("ssl","true");
props.setProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory");
Connection conn = DriverManager.getConnection(url, props);

Thank you for your help.

-- Chad



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-11-30 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-29 21:23 GCJ, SSL Connection Issue Chad Files <cpfiles@gmail.com>
2005-11-30 01:25 ` Kris Jurka <books@ejurka.com>
2005-11-30 13:45   ` Chad Files <cpfiles@gmail.com>

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