pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergei Agalakov <Sergei.Agalakov@getmyle.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: pgsql-bugs@postgresql.org
Subject: It seems to be a documentation bug to me then
Date: Mon, 9 May 2016 14:29:50 -0600
Message-ID: <37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

To resolve this confusion all we need is to add something like to 
documentation
http://www.postgresql.org/docs/9.5/static/libpq-ssl.html

Currently PostgreSQL supports only Subject Alternative Name attribute(s) 
of type dNSName, and IP type isn't supported.

and remove

If the connection is made using an IP address instead of a host name, 
the IP address will be matched (without doing any DNS lookups).

The last one seems to be incorrect, if the SAN IP attributes are ignored.
Am I correct?

Sergei Agalakov

> On 09/05/16 20:08, sergei(dot)agalakov(at)getmyle(dot)com wrote:
> > CentOS 7, OpenSSL 1.0.2h, Postgres 9.5.2
> > 1. Created server certificate signed by local CA with three Subject
> > Alternative Name values
> > $ openssl x509 -in server.crt -text -noout
> > ...
> > X509v3 Subject Alternative Name:
> >                  DNS:myle-db001a-small.c.myle-gce-proj-01.internal, IP
> > Address:162.222.177.29, IP Address:10.240.0.3
> > ...
> > 2. Created and copied root.crt for local CA certificate
> > 3. Switched SSL mode to verify-full
> > $export PGSSLMODE=verify-full
> > 4. $psql -h 10.240.0.3 -U postgres
> > psql: server certificate for "myle-db001a-small.c.myle-gce-proj-01.internal"
> > does not match host name "10.240.0.3"
> > According to E.3.3.1.4. SSL in
> >http://www.postgresql.org/docs/9.5/static/release-9-5.html
> > PG 9.5 should check all Subject Alternative Names to match in the
> > certificate. The same implies in
> >http://www.postgresql.org/docs/9.5/static/libpq-ssl.html
> > "In verify-full mode, the host name is matched against the certificate's
> > Subject Alternative Name attribute(s), or against the Common Name attribute
> > if no Subject Alternative Name of type dNSName is present."
> > An expected result was a SSL connection because one of SAN attributes
> > matched host name. Instead a connection was refused.
>
> PostgreSQL only pays attention to "DNS" SAN attributes, the IP addresses
> are ignored. It would be a nice feature if it did, but that hasn't been
> implemented.
>
> - Heikki
>

Message-ID: <37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com>
Permalink:  ../37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com/
Also on:    postgresql.org/message-id/37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com

 · 

reply

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: Sergei.Agalakov@getmyle.com, hlinnaka@iki.fi
  Subject: Re: It seems to be a documentation bug to me then
  In-Reply-To: <37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com>
  References: <37243100-aa81-1e38-ec77-c33e837e0c66@getmyle.com>

* 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