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 7394C329E8B for ; Wed, 15 Sep 2004 23:15:45 +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 28753-01 for ; Wed, 15 Sep 2004 22:15:39 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 499CB329C63 for ; Wed, 15 Sep 2004 23:15:40 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1C7i2V-0002sq-00; Thu, 16 Sep 2004 10:14:11 +1200 Message-ID: <4148BEB1.3010707@opencloud.com> Date: Thu, 16 Sep 2004 10:14:09 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: chinmoy , pgsql-jdbc@postgresql.org Subject: Re: Customizing SSL with jdbc References: <413E0480.8010306@avaya.com> <4145B31C.3000201@avaya.com> <1095206324.1000.25.camel@doug.ejurka.com> In-Reply-To: <1095206324.1000.25.camel@doug.ejurka.com> 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: 200409/73 X-Sequence-Number: 10963 Kris Jurka wrote: > On Mon, 2004-09-13 at 07:47, chinmoy wrote: > >>Hi >> Thanks for the reply. The only thing special about the factory is >>that it has access to the server certificate that is bundled with the >>client jars and is not installed in the jvm's trust store. I agree the >>static method is not the way to go as it affects all the connections. In >>my specific case it is okay as I know all the clients using the >>connections in agiven client jvm. > > > What about an additional URL parameter like > sslfactoryfactory=com.mycompany.myfactory, where the provided class must > implement something like: > > package org.postgresql; > > interface SSLSocketFactoryFactory { > public SSLSocketFactory getFactory(); > } > > Seems like this could work. Thoughts? Any other SSL options and things > people would want to tweak? I'm not sure how that extra level of indirection gives you anything. Haven't you just gone from "how do I configure my new SSLSocketFactory instance without context?" to "how do I configure my new SSLSocketFactoryFactory instance without context?" ? If we want per-connection SSL configurability (not just per-JVM) then it seems like we have to pass an actual instance to the driver at runtime. URL parameters aren't going to do the job unless we also pass factory-specific configuration info in the URL somehow, and that assumes that you can actually represent that info in the URL (e.g. you have more than just an object reference to your keystore..) I also dislike having the driver do any classloading of client classes itself. It causes havoc in a managed environment where the JDBC driver may be loaded in its own classloader that does not have access to the application classes. I added the new variant of PGConnection.addDataType to solve exactly this problem; let's not reintroduce it elsewhere. -O