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