Re: A solution to the SSL customizing problem

From: Ulrich Meis <kenobi(at)halifax(dot)rwth-aachen(dot)de>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: A solution to the SSL customizing problem
Date: 2004-10-15 04:48:03
Message-ID: 200410150648.03220.kenobi@halifax.rwth-aachen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Friday 15 October 2004 05:35, Oliver Jowett wrote:
>...
> getSSLSocketFactory() doesn't need to be duplicated. Just pass the
> connection properties to makeSSL and construct the factory from there.

done

> Use of SSL-specific code needs to be conditionally compiled or the
> driver will not build if JSSE is not present. This is easy to do if you
> move getSSLSocketFactory() into Driver.java.in.

I see...it's all in makeSSL now and prefixed by @SSL@

> This doesn't look right, what is '&urlServer&'?
>
> > + Object[] args = { info.getProperty("&urlServer&"),
> > info.getProperty("sslfactoryargs") };

In parseURL I added a line to set that property to the connection url string
without parameters. It's the easiest way I am aware of to get the exact url
down to makeSSL. Since parseURL simply splits parameters upon & and doesn't
convert escaped &s, I used the &s to make absolutely sure that this property
never clashes with a real url parameter - also that wouldn't actually matter.
If nothing else, it makes it obvious that this is internal.

An alternative would be to reconstruct the url via the parameters. I didn't
choose that approach for two reasons:
1. A lot more lines of code
2. For implementors of a SSLSocketFactory, it would break the approach of
simply comparing the received string with the original connection url
provided because it might slightly differ(in case for instance).

Uli

Attachment Content-Type Size
pgjdbc-custom-ssl2.txt text/plain 7.0 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-10-15 05:28:02 Re: A solution to the SSL customizing problem
Previous Message Oliver Jowett 2004-10-15 03:35:01 Re: A solution to the SSL customizing problem