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 76A23329E15 for ; Mon, 13 Sep 2004 10:25:53 +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 09871-06 for ; Mon, 13 Sep 2004 09:25:47 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id B22F2329E6B for ; Mon, 13 Sep 2004 10:25:47 +0100 (BST) Received: (qmail 32170 invoked by uid 1112); 13 Sep 2004 07:48:52 -0000 Date: Mon, 13 Sep 2004 02:48:52 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: chinmoy Cc: pgsql-jdbc@postgresql.org Subject: Re: Customizing SSL with jdbc In-Reply-To: <413E0480.8010306@avaya.com> Message-ID: References: <413E0480.8010306@avaya.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/45 X-Sequence-Number: 10935 On Tue, 7 Sep 2004, chinmoy wrote: > Hi > I am using the jdbc driver for postgresql 7.4.5. I would like it to > use a custom SSLSocketFactory. It seems like the Driver uses the > javax.net.ssl.SSLSocketFactory.getDefault() method to create a socket > factory. Other than compiling the Driver with a different class, is > there any other way of doing this? For eg would it be worthwhile to > provide a method in the org.postgresql.Driver class that lets one set > the class that would then be aksed in the makeSSL method to create the > SSLSocketFactory instance.? > Chinmoy > There was some discussion of this, notably to provide a ssl connection without adding the servers certificate to the jvm's trust store (which can be a pain). Recently Oliver had proposed adjusting our ssl url parameter to add some more options like request vs. require to use ssl if available. I had considered adding a noauth or similar option to try and meet these requirements. What's special about your SSLSocketFactory? Is it something others would be interested in as a generally useful thing or something very specific? The problem with adding a call to org.postgresql.Driver is that it must use a static variable that affects all connections. It would be better to use a url parameter somehow. See the discussions here: http://archives.postgresql.org/pgsql-jdbc/2004-02/msg00184.php http://archives.postgresql.org/pgsql-jdbc/2004-02/msg00199.php Kris Jurka