Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azog8-0005jf-AV for pgsql-bugs@arkaria.postgresql.org; Mon, 09 May 2016 17:09:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1azog7-0001LE-O3 for pgsql-bugs@arkaria.postgresql.org; Mon, 09 May 2016 17:09:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1azog7-0001KD-6F for pgsql-bugs@postgresql.org; Mon, 09 May 2016 17:09:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azog2-0006Cu-Un for pgsql-bugs@postgresql.org; Mon, 09 May 2016 17:09:06 +0000 MIME-Version: 1.0 Subject: BUG #14130: SSL certifiate's Subject Alternative Name isn't check correctly To: pgsql-bugs@postgresql.org From: sergei.agalakov@getmyle.com Date: Mon, 09 May 2016 17:08:10 +0000 Message-ID: <20160509170810.2690.41247@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 14130 Logged by: Sergei Agalakov Email address: sergei.agalakov@getmyle.com PostgreSQL version: 9.5.2 Operating system: CentOS 7 Description: 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. Thank you, Sergei Agalakov -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs