Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbPSi-0001EM-7B for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 15:49:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbPSg-0005RG-Q2 for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 15:49:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbPSg-0005R6-GQ for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 15:49:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbPSd-0008SN-JK for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 15:49:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19FFnSOF959130; Fri, 15 Oct 2021 11:49:28 -0400 From: Tom Lane To: "Zwettler Markus (OIZ)" cc: "pgsql-general@lists.postgresql.org" Subject: Re: postgres ssl client certificate authentification In-reply-to: <54285c6f118c4aa1b5b7a5bfc99bd840@zuerich.ch> References: <54285c6f118c4aa1b5b7a5bfc99bd840@zuerich.ch> Comments: In-reply-to "Zwettler Markus (OIZ)" message dated "Fri, 15 Oct 2021 15:32:25 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <959128.1634312968.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 15 Oct 2021 11:49:28 -0400 Message-ID: <959129.1634312968@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Zwettler Markus (OIZ)" writes: > I am playing around with postgres ssl encryption. I am confused about cl= ient certificate authentication: > > The second approach combines any authentication method for hostssl entri= es with the verification of client certificates by setting the clientcert = authentication option to verify-ca or verify-full. The former option only = enforces that the certificate is valid, while the latter also ensures that= the cn (Common Name) in the certificate matches the user name or an appli= cable mapping. > > https://www.postgresql.org/docs/12/ssl-tcp.html Given that your server is 9.6.x, you're reading the wrong version of the docs. Per https://www.postgresql.org/docs/9.6/auth-pg-hba-conf.html the only clientcert value that does anything is "1": In addition to the method-specific options listed below, there is one method-independent authentication option clientcert, which can be specified in any hostssl record. When set to 1, this option requires the client to present a valid (trusted) SSL certificate, in addition to the other requirements of the authentication method. regards, tom lane