pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ulrich Meis <kenobi@halifax.rwth-aachen.de>
To: pgsql-jdbc@postgresql.org
Subject: Re: A solution to the SSL customizing problem
Date: Thu, 14 Oct 2004 02:24:56 +0200
Message-ID: <200410140224.56728.kenobi@halifax.rwth-aachen.de> (raw)
In-Reply-To: <200410111752.33375.kenobi@halifax.rwth-aachen.de>
References: <200410111752.33375.kenobi@halifax.rwth-aachen.de>

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




view thread (31+ messages)  latest in thread

Message-ID: <200410140224.56728.kenobi@halifax.rwth-aachen.de>
Permalink:  ../200410140224.56728.kenobi@halifax.rwth-aachen.de/
Also on:    postgresql.org/message-id/200410140224.56728.kenobi@halifax.rwth-aachen.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: kenobi@halifax.rwth-aachen.de
  Subject: Re: A solution to the SSL customizing problem
  In-Reply-To: <200410140224.56728.kenobi@halifax.rwth-aachen.de>
  References: <200410111752.33375.kenobi@halifax.rwth-aachen.de> <200410140224.56728.kenobi@halifax.rwth-aachen.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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