X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 87E30D1C4D0 for ; Tue, 22 Jul 2003 23:11:13 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 03336-01 for ; Tue, 22 Jul 2003 20:10:29 -0300 (ADT) Received: from tanis.hss.caltech.edu (tanis.hss.caltech.edu [131.215.23.122]) by svr1.postgresql.org (Postfix) with ESMTP id 16C63D1C4C8 for ; Tue, 22 Jul 2003 20:11:11 -0300 (ADT) Received: from hss.caltech.edu (economex.caltech.edu [131.215.22.66]) by tanis.hss.caltech.edu (8.12.9/8.12.8) with ESMTP id h6MNBD1s010367 for ; Tue, 22 Jul 2003 16:11:13 -0700 (PDT) Message-ID: <3F1DC437.2080104@hss.caltech.edu> Date: Tue, 22 Jul 2003 16:09:43 -0700 From: Charles Hornberger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: using ssl some of the time Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/232 X-Sequence-Number: 9572 I'm having a bit of trouble understanding exactly how SSL-encrypted connections are supposed to work -- and specifically whether it's possible to "use SSL some of the time." Here's what I want to do: 1) I want one of my web servers to be able to connect to the database without the overhead of SSL (it connects as an unprivileged user who just does SELECTs). 2) I want to allow connections from another machine -- also a web server -- ONLY if they're encrypted with SSL (users with the ability to INSERT/UPDATE will be connecting with passwords via a web/db interface hosted on this machine). It seems to me that I can't do both. If I turn on the 'ssl=true' option in $PGDATA/postgresql.conf, then connections from psql at least are _always_ encrypted, no matter what's in pg_hba.conf. For the record, here's what's in pg_hba.conf (notably, there's no hostssl entry): local all all trust host all all 127.0.0.1 255.255.255.255 trust And here's what happens when I connect with psql: [economex] charlie/$ psql -h 127.0.0.1 template1 Welcome to psql 7.3.1, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit SSL connection (cipher: EDH-RSA-DES-CBC3-SHA, bits: 168) template1=> \q ... which looks encrypted to me. Am I right in interpreting this to mean that I either have to use SSL all the time or none of the time? I'm especially tempted to believe this might be the case after seeing this item in the "Clients" section of http://developer.postgresql.org/todo.php: - Allow SSL-enabled clients to turn off SSL transfers Does that mean that, if SSL is enabled for the postmaster, the client will always be forced to use SSL? Or is there something I need to do to force the client to NOT use SSL? Thanks, Charlie