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 200410150648.03220.kenobi@halifax.rwth-aachen.de
Whole thread Raw
In response to Re: A solution to the SSL customizing problem  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: A solution to the SSL customizing problem
List 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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: A solution to the SSL customizing problem
Next
From: Oliver Jowett
Date:
Subject: Re: A solution to the SSL customizing problem