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 7E876329FDC for ; Mon, 11 Oct 2004 23:36:27 +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 92751-05 for ; Mon, 11 Oct 2004 22:36:23 +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 B813C329F4D for ; Mon, 11 Oct 2004 23:36:24 +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 <0I5F006SFYSM6U@ms-dienst.rz.rwth-aachen.de> for pgsql-jdbc@postgresql.org; Tue, 12 Oct 2004 00:36:23 +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 00:36:22 +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 i9BMaLb3000642 for ; Tue, 12 Oct 2004 00:36:21 +0200 (MEST) Received: (qmail 28962 invoked from network); Mon, 11 Oct 2004 22:36:21 +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 ; Mon, 11 Oct 2004 22:36:21 +0000 Date: Tue, 12 Oct 2004 00:36:12 +0200 From: Ulrich Meis Subject: Re: A solution to the SSL customizing problem In-reply-to: <12449.1097512805@sss.pgh.pa.us> To: Tom Lane Cc: pgsql-jdbc@postgresql.org Message-id: <200410120036.12968.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> <12449.1097512805@sss.pgh.pa.us> 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/93 X-Sequence-Number: 11198 On Monday 11 October 2004 18:40, Tom Lane wrote: > Ulrich Meis writes: > > I propose a different solution. > > One small question --- have you checked that this behaves reasonably > with both a CVS-tip postmaster and prior releases? CVS tip does do > certificate presentation and checking, whereas that stuff was > mistakenly disabled in 7.4. (I think all the relevant changes are > present in 8.0beta3, but not earlier.) No, I only tested on 7.4.5 (plz see notes below). But it does present its certificate, I saved it a hundred times ;-) I don't think Java would accept a SSL connection without presentation of a certificate. Using a different trustStore and trust policy by itself doesn't change the behavior towards postmaster.The custom SSLContext and the resulting SSLContextFactory use the defaults in all other cases, so in effect there shouldn't be any difference in behavior. In other words if the postmaster works with the current driver, it will work with the customization, too. If you are concerned about getting errors in connections that don't use one of the introduced features, please take a look at the first three lines of createSocket ********* public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException { if ((System.getProperty("org.postgresql.Driver.trustStore") == null) && (System.getProperty("org.postgresql.ssl_trustandsave") == null)) return ((SSLSocketFactory) SSLSocketFactory.getDefault()).createSocket(socket, host, port, autoClose); ********* If no custom behavior is specified, the class uses the same line of code as you can find in the current Driver.java. That way bugs in the new class are only exposed if you use a feature. Uli