Re: A solution to the SSL customizing problem

From: Ulrich Meis <kenobi(at)halifax(dot)rwth-aachen(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: A solution to the SSL customizing problem
Date: 2004-10-14 00:24:56
Message-ID: 200410140224.56728.kenobi@halifax.rwth-aachen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-10-14 00:43:55 Re: A solution to the SSL customizing problem
Previous Message Jair da Silva Ferreira Jr 2004-10-13 23:26:09 problem with dates when using a java calendar object with a non-default timezone