X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DFC0732ABB3 for ; Tue, 12 Oct 2004 05:34:32 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79922-06 for ; Tue, 12 Oct 2004 04:34:23 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 840FF32C242 for ; Tue, 12 Oct 2004 05:34:22 +0100 (BST) Received: from flood.opencloud.co.nz ([192.168.0.31]) by yass.opencloud.co.nz with esmtp (Exim 3.35 #1 (Debian)) id 1CHEMP-0001d4-00; Tue, 12 Oct 2004 17:34:05 +1300 Message-ID: <416B5EBC.6060507@opencloud.com> Date: Tue, 12 Oct 2004 17:34:04 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ulrich Meis Cc: pgsql-jdbc@postgresql.org Subject: Re: A solution to the SSL customizing problem References: <200410111752.33375.kenobi@halifax.rwth-aachen.de> <200410120432.20158.kenobi@halifax.rwth-aachen.de> <416B4820.8040601@opencloud.com> <200410120620.04002.kenobi@halifax.rwth-aachen.de> In-Reply-To: <200410120620.04002.kenobi@halifax.rwth-aachen.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/100 X-Sequence-Number: 11205 Ulrich Meis wrote: > On Tuesday 12 October 2004 04:57, Oliver Jowett wrote: > > >>So I suggest you look at solving the "how do I give the driver an >>appropriate SSLSocketFactory" problem first. Once that is solved, the >>particular configurable behaviour you want can be easily implemented. > > > How about my suggestions with the abstract handler class? > I know it was a long post ;-) Namely: > In the Driver class you offer a method(make it empty if compiled without SSL): > > setPGSSLHandler(PGSSLHandler handler) { > pgsslhandler=handler;} > > abstract class PGSSLHandler { > > public static final int STANDARD=0; > public static final int CUSTOMFACTORY=1; > public static final int CUSTOMSTORE=2; > > abstract public int getHandleType(int conid); > abstract public boolean getTrustAndSave(int conid); > > abstract public KeyStore getKeyStore(int conid); > abstract public SSLSocketFactory getSSLSocketFactory(int conid); > > } How do you arrange for setPGSSLHandler to be called if you are in a managed environment that does not know anything about the postgresql driver beyond the standard JDBC interfaces? The "conid" stuff looks really grotty. How do you coordinate the URL-level configuration with the PGSSLHandler implementation? Why is anything but getSSLSocketFactory() needed? You can implement whatever keystore/truststore policy you want via a SSLSocketFactory. The only new thing there is really the conid stuff, and I'd rather deal with classloader issues (specify the class by name, loaded by the driver) than have to deal with managing magic opaque unique configuration keys and a postgresql-specific interface. -O