Re: A solution to the SSL customizing problem - Mailing list pgsql-jdbc

From Ulrich Meis
Subject Re: A solution to the SSL customizing problem
Date
Msg-id 200410140224.56728.kenobi@halifax.rwth-aachen.de
Whole thread Raw
In response to A solution to the SSL customizing problem  (Ulrich Meis <kenobi@halifax.rwth-aachen.de>)
Responses Re: A solution to the SSL customizing problem
List pgsql-jdbc
Now what I got from the discussion:

1. New URL parameters:

sslfactory=a.class.name
sslfactoryargs=driver=does,not=care

These are forwarded to

2. makeSSL which does something like

if (sslfactory!=null) { //sslfactory url parameter
 factory = instantiated class, handle exceptions
 }
else if (DSfactory!=null) { // factory set via DataSource
 factory = dsfactory;
 }
else factory = SSLSocketFactory.getDefault();
if (factory instanceof PGSSLHandler) {
 ((PGSSLHandler)factory).setPGURL(...);
 ((PGSSLHandler)factory).setPGargs(...);
 }
java.net.Socket newConnection = factory.createsocket(....);
....

3. a new abstract class

abstract PGSSLHandler extends SSLSocketFactory {

public void setPGURL(String url_no_parameters);
public void setPGargs(String args);

}

4. in Driver

protected setSSLSocketFactory(SSLSocketfactory factory) {
 DSfactory=factory;
 }

5. in BaseDataSource

public void setPG_SSLSocketFactory(SSLSocketFactory factory) {
((org.postgresql.Driver)DriverManager.getDriver("jdbc:postgresql://server/db")).setSSLSocketFactory(factory);
 }


How does that sound?
I would offer a concrete implementation unless someone else wants to do it and
if I knew you're interested.

Uli


pgsql-jdbc by date:

Previous
From: Jair da Silva Ferreira Jr
Date:
Subject: problem with dates when using a java calendar object with a non-default timezone
Next
From: Oliver Jowett
Date:
Subject: Re: A solution to the SSL customizing problem