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 B134932BB8E for ; Thu, 14 Oct 2004 01:27:06 +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 84275-04 for ; Thu, 14 Oct 2004 00:27:02 +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 1E6A732A921 for ; Thu, 14 Oct 2004 01:27:03 +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 <0I5J00IDKT5QW2@ms-dienst.rz.rwth-aachen.de> for pgsql-jdbc@postgresql.org; Thu, 14 Oct 2004 02:25:03 +0200 (MEST) Received: from relay.rwth-aachen.de ([134.130.3.1]) by r220-1 (MailMonitor for SMTP v1.2.2 ) ; Thu, 14 Oct 2004 02:25:02 +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 i9E0P17g007444 for ; Thu, 14 Oct 2004 02:25:02 +0200 (MEST) Received: (qmail 3178 invoked from network); Thu, 14 Oct 2004 00:25:02 +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 ; Thu, 14 Oct 2004 00:25:02 +0000 Date: Thu, 14 Oct 2004 02:24:56 +0200 From: Ulrich Meis Subject: Re: A solution to the SSL customizing problem In-reply-to: <200410111752.33375.kenobi@halifax.rwth-aachen.de> To: pgsql-jdbc@postgresql.org Message-id: <200410140224.56728.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> 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/131 X-Sequence-Number: 11236 Now what I got from the discussion: 1. New URL parameters: sslfactory=a.class.name sslfactoryargs=driver=does,not=care These are forwarded to 2. makeSSL which does something like if (sslfactory!=null) { //sslfactory url parameter factory = instantiated class, handle exceptions } else if (DSfactory!=null) { // factory set via DataSource factory = dsfactory; } else factory = SSLSocketFactory.getDefault(); if (factory instanceof PGSSLHandler) { ((PGSSLHandler)factory).setPGURL(...); ((PGSSLHandler)factory).setPGargs(...); } java.net.Socket newConnection = factory.createsocket(....); .... 3. a new abstract class abstract PGSSLHandler extends SSLSocketFactory { public void setPGURL(String url_no_parameters); public void setPGargs(String args); } 4. in Driver protected setSSLSocketFactory(SSLSocketfactory factory) { DSfactory=factory; } 5. in BaseDataSource public void setPG_SSLSocketFactory(SSLSocketFactory factory) { ((org.postgresql.Driver)DriverManager.getDriver("jdbc:postgresql://server/db")).setSSLSocketFactory(factory); } How does that sound? I would offer a concrete implementation unless someone else wants to do it and if I knew you're interested. Uli