From: Lou Picciano <loupicciano@comcast.net>
To: Magnus Hagander <magnus@hagander.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Srinivas Aji <srinivas.aji@emc.com>
Subject: Re: Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present
Date: Fri, 23 Sep 2011 12:35:28 +0000 (UTC)
Message-ID: <1221006623.1866841.1316781328448.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net> (raw)
In-Reply-To: <CABUevExm7ZsVasLX3wfG7gzk2opaCwRtU=ztg6rErS5yNxPonA@mail.gmail.com>
From: "Magnus Hagander" <magnus@hagander.net>
To: "Srinivas Aji" <srinivas.aji@emc.com>
Cc: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Sent: Friday, September 23, 2011 7:28:09 AM
Subject: [HACKERS] Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present
On Wed, Aug 31, 2011 at 11:59, Srinivas Aji <srinivas.aji@emc.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: 6189
> Logged by: Srinivas Aji
> Email address: srinivas.aji@emc.com
> PostgreSQL version: 9.0.4
> Operating system: Linux
> Description: libpq: sslmode=require verifies server certificate if
> root.crt is present
> Details:
>
...
>
> The observed behaviour is a bit different. If the ~/.postgresql/root.crt
> file (or any other filename set through sslrootcert option) is found,
> sslmode=require also performs the same level of certificate verification as
> verify-ca. The difference between require and verify-ca is that it is an
> error for the file to not exist when sslmode is verify-ca.
I looked at this again, and I'm pretty sure we did this intentionally.
The idea being that before we had the verify-ca/verify-full options,
adding the root cert would enable the verification. And we didn't want
to turn installations that previously did verify the certificate to
stop doing so in the new version.
So basically, the behaviour that is by design is:
* require: if certificate exists, verify. if certificate doesn't
exist, don't verify.
* verify-ca: if certificate exists, verify. if certificate doesn't
exist, disconnect.
The question is, have we had the new options long enough now that we
should change it so that we don't verify the cert in the case of
cert-exists-but-verification-wasn't-explicitly-asked-for?
Or should we just update the documentation to mention how this works?
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
Magnus, If you're accepting votes on this: I would say 'yes' - change the behavior to the most logically consistent ones; ie, isolate the verification bits a bit more explicitly. And, in documentation, indicate the deprecation of the old behavior.
Our mileage, in practical terms, is that the perceived inconsistencies create a minor support hassle - we don't want to present any - even trivial - hurdle to adoption of SSL to our clients.
Lou Picciano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: loupicciano@comcast.net, magnus@hagander.net, pgsql-hackers@postgresql.org, srinivas.aji@emc.com
Subject: Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present
In-Reply-To: <1221006623.1866841.1316781328448.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net>
References: <CABUevExm7ZsVasLX3wfG7gzk2opaCwRtU=ztg6rErS5yNxPonA@mail.gmail.com> <1221006623.1866841.1316781328448.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox