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 9FF1832A561 for ; Tue, 12 Oct 2004 22:56:26 +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 37969-09 for ; Tue, 12 Oct 2004 21:56:16 +0000 (GMT) Received: from ms-dienst.rz.rwth-aachen.de (ms-1.rz.RWTH-Aachen.DE [134.130.3.130]) by svr1.postgresql.org (Postfix) with ESMTP id E9F8132A7DD for ; Tue, 12 Oct 2004 22:56:18 +0100 (BST) Received: from r220-1 (r220-1.rz.RWTH-Aachen.DE [134.130.3.31]) by ms-dienst.rz.rwth-aachen.de (iPlanet Messaging Server 5.2 HotFix 1.12 (built Feb 13 2003)) with ESMTP id <0I5H00J3VRF3OY@ms-dienst.rz.rwth-aachen.de> for pgsql-jdbc@postgresql.org; Tue, 12 Oct 2004 23:52:16 +0200 (MEST) Received: from relay.rwth-aachen.de ([134.130.3.1]) by r220-1 (MailMonitor for SMTP v1.2.2 ) ; Tue, 12 Oct 2004 23:52:15 +0200 (MEST) Received: from post.halifax.rwth-aachen.de (post.halifax.RWTH-Aachen.DE [134.130.49.251]) by relay.rwth-aachen.de (8.13.0/8.13.0/1) with ESMTP id i9CLqFlN012671 for ; Tue, 12 Oct 2004 23:52:15 +0200 (MEST) Received: (qmail 12591 invoked from network); Tue, 12 Oct 2004 21:52:22 +0000 Received: from darkenemy.halifax.rwth-aachen.de ([134.130.48.36]) (envelope-sender ) by mail.halifax.rwth-aachen.de (qmail-ldap-1.03) with SMTP for ; Tue, 12 Oct 2004 21:52:22 +0000 Date: Tue, 12 Oct 2004 23:52:08 +0200 From: Ulrich Meis Subject: Re: A solution to the SSL customizing problem In-reply-to: <416C48C1.1060400@opencloud.com> To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Message-id: <200410122352.08766.kenobi@halifax.rwth-aachen.de> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: KMail/1.7 References: <200410111752.33375.kenobi@halifax.rwth-aachen.de> <200410122149.00987.kenobi@halifax.rwth-aachen.de> <416C48C1.1060400@opencloud.com> 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/114 X-Sequence-Number: 11219 On Tuesday 12 October 2004 23:12, Oliver Jowett wrote: > Ulrich Meis wrote: > > On Tuesday 12 October 2004 10:23, Oliver Jowett wrote: > [...] > > Sounds good to me. > > I would suggest an additional URL parameter and method on PG DataSource > > for the connection/database id. > > See above :) Alright, finally I got your point ;-) > If you want to pass configuration information to the instantiated class > (and that is really what you're trying to do here, right?), a better way > seems to be to include all of that information directly in the URL > rather than adding more indirection. i.e. something like: > > jdbc:postgresql://server:port/dbname?sslfactory=my.factory&sslfactoryargs=t >ruststore=foo,behaviour=bar I totally agree. > Or even just provide the whole URL-derived Properties object to the > instantiated class and let it pick out whichever properties it wants. > Though I don't like passing all Properties as it makes the set of valid > properties for a connection unpredictable. Among other things this means > you can't correctly implement Driver.getPropertyInfo(). How about passing 1. the URL without parameters so the factory knows which server&database it's dealing with 2. a sslfactoryargs parameter as you described? That way the factory can easily identify which certificate belongs to which server. > > Another completely different idea that I haven't tested and/or thought > > through yet: > > > > How about passing a JNDI name in the URL that users and/or app servers > > bind their custom SSLSocketFactory to? > > You have no guarantees that there is a JNDI provider available or that > it works as you expect from the driver's context or that you even have > permission to bind into it. So this seems like a really bad idea. Again, agreed. I wanted to come around the problem that the user cannot provide his own factory in a managed environment, but seeing that this functionality isn't desired anyway, the problem vanishes. > As a concrete example, if you try to do this in our appserver things are > going to blow up horribly -- there is a separate JNDI tree per > application, applications have a readonly view of their tree, and > non-application code such as JDBC drivers has no guarantees about which > tree (if any) is visible when they are executing. > > > JNDI is included since jdk1.3 and there's a jndi.jar for jdk1.2. > > The infrastructure is there, but the default providers leave a lot to be > desired. There's no purely in-memory provider, for example. My thoughts were upon simple-jndi from osjava for a stand alone application. Uli