Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1010EB5DC09 for ; Fri, 23 Sep 2011 09:35:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 87240-04 for ; Fri, 23 Sep 2011 12:35:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from qmta04.westchester.pa.mail.comcast.net (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) by mail.postgresql.org (Postfix) with ESMTP id D207DB5DBF7 for ; Fri, 23 Sep 2011 09:35:28 -0300 (ADT) Received: from omta21.westchester.pa.mail.comcast.net ([76.96.62.72]) by qmta04.westchester.pa.mail.comcast.net with comcast id cCWg1h0091ZXKqc54CbUg0; Fri, 23 Sep 2011 12:35:28 +0000 Received: from sz0093.wc.mail.comcast.net ([76.96.58.151]) by omta21.westchester.pa.mail.comcast.net with comcast id cCbU1h00N3FmDic3hCbUSy; Fri, 23 Sep 2011 12:35:28 +0000 Date: Fri, 23 Sep 2011 12:35:28 +0000 (UTC) From: Lou Picciano To: Magnus Hagander Cc: PostgreSQL-development , Srinivas Aji Message-ID: <1221006623.1866841.1316781328448.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net> In-Reply-To: Subject: Re: Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1866840_1796435628.1316781328447" X-Originating-IP: [76.117.178.80] X-Mailer: Zimbra 6.0.10_GA_2709 (ZimbraWebClient - FF3.0 (Mac)/6.0.10_GA_2697) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.402 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/1186 X-Sequence-Number: 195375 ------=_Part_1866840_1796435628.1316781328447 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit From: "Magnus Hagander" To: "Srinivas Aji" Cc: "PostgreSQL-development" 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 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 ------=_Part_1866840_1796435628.1316781328447 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <= div style=3D'font-family: Verdana; font-size: 12pt; color: #000000'>From= : "Magnus Hagander" <magnus@hagander.net>
To: "Srinivas= Aji" <srinivas.aji@emc.com>
Cc: "PostgreSQL-development" &= lt;pgsql-hackers@postgresql.org>
Sent: Friday, September 23, 2= 011 7:28:09 AM
Subject: [HACKERS] Re: [BUGS] BUG #6189: libpq: ss= lmode=3Drequire verifies server certificate if root.crt is present

O= n Wed, Aug 31, 2011 at 11:59, Srinivas Aji <srinivas.aji@emc.com> wro= te:
>
> The following bug has been logged online:
>
&g= t; Bug reference:      6189
> Logged by:    =      Srinivas Aji
> Email address:     &nbs= p;srinivas.aji@emc.com
> PostgreSQL version: 9.0.4
> Operating = system:   Linux
> Description:        libpq:= sslmode=3Drequire verifies server certificate if
> root.crt is prese= nt
> Details:
>
...
>
> The observed behaviour i= s a bit different. If the ~/.postgresql/root.crt
> file (or any other= filename set through sslrootcert option) is found,
> sslmode=3Drequi= re also performs the same level of certificate verification as
> veri= fy-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 looke= d 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 inst= allations that previously did verify the certificate to
stop doing so in= the new version.

So basically, the behaviour that is by design is:<= br>* require: if certificate exists, verify. if certificate doesn't
exis= t, don't verify.
* verify-ca: if certificate exists, verify. if certific= ate doesn't
exist, disconnect.

The question is, have we had the n= ew options long enough now that we
should change it so that we don't ver= ify the cert in the case of
cert-exists-but-verification-wasn't-explicit= ly-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 th= e old behavior.

Our mileage, in practical terms, is that the perceiv= ed 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
------=_Part_1866840_1796435628.1316781328447--