Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azorl-0006h5-Bb for pgsql-bugs@arkaria.postgresql.org; Mon, 09 May 2016 17:21:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1azork-00067H-Uc for pgsql-bugs@arkaria.postgresql.org; Mon, 09 May 2016 17:21:08 +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 1azorj-00064w-O3 for pgsql-bugs@postgresql.org; Mon, 09 May 2016 17:21:07 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1azorf-0006Xn-KZ for pgsql-bugs@postgresql.org; Mon, 09 May 2016 17:21:07 +0000 Received: by mail-pf0-x22b.google.com with SMTP id 77so77974497pfv.2 for ; Mon, 09 May 2016 10:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=dIbv8Syhml6bgbVPDt/9e0dZBqrdFXdZTL2eXjZGoqE=; b=ZFXlg2HnDtPQ3a/+xunulyryqEZ11KLAz1+2uMtsCmNOqnU6C/5Dd6pz0CEH9J/B6N 064OIn+n9zjsnwODJ+e+t7TKz9VUOc/noYQIZT7YpSAa/cPIAjuqypP7VmgvoAUqpTrv NOuDt5WsDBCrZr+gtc1YkNmlWFoLcjJBCKHI5z95q8T7Ekq96ksYInpEg2aLd61pCwTr 8RpuF02eaGKoVlama8IOOvUW7tvzURq4JawFWbQK4oXpDB65ElBzKH5p0DYqleVrhmnR CWqBShVgUfLVgg6ED4lB8PWbYzlgmVBuUucyLmmOKOaNv3KdCEmh/AQarAZnd5jOWHrF vXwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=dIbv8Syhml6bgbVPDt/9e0dZBqrdFXdZTL2eXjZGoqE=; b=IARfu1aBESp5LysiUGoO6MaJRuti9P3i5/5SbwGQR1gMWLTW/7hyRWmPwbdLgswQCH 5JBcgLavQwYLxXwJh3HhomjWQdLpFIAIrYrGCeL0+UkW/GKuYcwb7FuALjMlWQpxyoty DdKdSXLst/Xh/U4HqXZR9DTY3fSsatCDXwU4k8FuIIOCzONCcNmQTb5LEsy1io5LyAdP OjRWY7qgvfgAETWhpW66R+PzSbLFpsjWc26oRmNya0Omhgw9tEq5nX9mS7+g0hFVUtpw knVZD8urFMKK2a4L/JXPBQZfp/JX5i6uhyJp73Sdk4Awrxsk9deA6wr97w4eK6wdAmMz v80Q== X-Gm-Message-State: AOPr4FVTTkjBl53aSNpjV/BGe1tdrfnJ5XS1weKRJkXoL48Pv+7EEyQ3HXyAYL+vX5nIEA== X-Received: by 10.98.93.5 with SMTP id r5mr51114533pfb.15.1462814461284; Mon, 09 May 2016 10:21:01 -0700 (PDT) Received: from [192.168.1.111] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by smtp.gmail.com with ESMTPSA id i75sm18559163pfj.51.2016.05.09.10.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 May 2016 10:21:00 -0700 (PDT) Subject: Re: BUG #14130: SSL certifiate's Subject Alternative Name isn't check correctly To: sergei.agalakov@getmyle.com, pgsql-bugs@postgresql.org References: <20160509170810.2690.41247@wrigleys.postgresql.org> From: Heikki Linnakangas Message-ID: <5730C6F6.2000302@iki.fi> Date: Mon, 9 May 2016 20:20:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: <20160509170810.2690.41247@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) 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 On 09/05/16 20:08, sergei.agalakov@getmyle.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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs