Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJmSk-0003b5-2i for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2014 16:40:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJmSj-0005AP-JE for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2014 16:40:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJmSi-0005AC-5K for pgsql-hackers@postgresql.org; Tue, 19 Aug 2014 16:40:44 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XJmSc-0006Ac-Rk for pgsql-hackers@postgresql.org; Tue, 19 Aug 2014 16:40:43 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id DE30429E34; Tue, 19 Aug 2014 09:40:34 -0700 (PDT) Received: from EX13-CAS-009.vmware.com (EX13-CAS-009.vmware.com [10.113.191.61]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id D878319960; Tue, 19 Aug 2014 09:40:34 -0700 (PDT) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-001.vmware.com (10.113.191.21) with Microsoft SMTP Server (TLS) id 15.0.775.38; Tue, 19 Aug 2014 09:40:28 -0700 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.775.38; Tue, 19 Aug 2014 09:40:27 -0700 Message-ID: <53F37DF3.5070107@vmware.com> Date: Tue, 19 Aug 2014 19:40:19 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Magnus Hagander , Stephen Frost CC: PostgreSQL-development Subject: Re: PQgetssl() and alternative SSL implementations References: <53F1E989.8020609@vmware.com> <20140819144841.GA16422@tamriel.snowman.net> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 08/19/2014 06:00 PM, Magnus Hagander wrote: > On Tue, Aug 19, 2014 at 4:48 PM, Stephen Frost wrote: >> * Heikki Linnakangas (hlinnakangas@vmware.com) wrote: >>> server_cert_valid: Did the server present a valid certificate? >>> "yes" or "no" >>> >>> server_cert_matches_host: Does the Common Name of the certificate >>> match the host connected to? "yes" or "no" >> >> Aren't these questions addressed by sslmode? > > Not entirely. You can have sslmode=require and have a matching > certificate. You don't *have* to have sslmode=verify-full for that. > > However, whether it makes *sense* without sslmode is another story - > but assuming you use something like kerberos for auth, it might. For > password, you've already lost once you get that far. Hmm, right, because the client application doesn't get control between libpq doing the SSL negotiation and sending the password to the server. So if after connecting you decided that you don't actually trust the server, you've already sent to password. Not good. You might think that you could try connecting without password first, and try again with the password, but that's not safe either, because there's no guarantee that the second connection reaches the same server as the first one. I think we need a callback or new asynchronous polling state after SSL negotiation but before libpq sends the password to the server. But that's a separate feature and patch. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers