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 1mbPCB-0000E8-Mh for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 15:32:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbPCA-0007mP-Br for pgsql-general@arkaria.postgresql.org; Fri, 15 Oct 2021 15:32:30 +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 1mbPCA-0007mG-00 for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 15:32:30 +0000 Received: from mx4.stadt-zuerich.ch ([194.56.33.13]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbPC7-0008Jj-8c for pgsql-general@lists.postgresql.org; Fri, 15 Oct 2021 15:32:29 +0000 IronPort-SDR: t2X1+4pdA/aidNc9arh6548n3H0WeID/csHDMJY1yR8KkChVJAsuYDd4Hlo5wNzKyOlGcnqAKm Tcqp7bxx27A5iUFGXHCsmx2KXbz8kmR55uA8nQy4fB0wBmJKQ5zkz+/MjNGvwE29bEEv9sQ0LF scgNNPxIVZd4JRGKu1KK0R2N/uEUitNJhvrkm6+D83Af0AzSpyAHuLMQq3E8k5h3sG/Y0/N/9p OrTxVJYX/IuTecL+1pwL9fsa4F/vAH+9ba0K7ihLZZnyQDQ0jQ7/1FFDHtouOT2NbiIALkJQ27 fS8= X-IronPort-AV: E=Sophos;i="5.85,376,1624312800"; d="scan'208,217";a="21271085" Received: from unknown (HELO SZHM29233.global.szh.loc) ([10.7.49.90]) by mx4.prm.szh.zone with ESMTP/TLS/AES256-GCM-SHA384; 15 Oct 2021 17:32:25 +0200 Received: from SZHM27370.global.szh.loc (10.7.50.50) by SZHM29233.global.szh.loc (10.7.49.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 15 Oct 2021 17:32:25 +0200 Received: from SZHM27370.global.szh.loc ([fe80::25ce:879f:5795:3325]) by SZHM27370.global.szh.loc ([fe80::25ce:879f:5795:3325%10]) with mapi id 15.01.2176.012; Fri, 15 Oct 2021 17:32:25 +0200 From: "Zwettler Markus (OIZ)" To: "pgsql-general@lists.postgresql.org" Subject: postgres ssl client certificate authentification Thread-Topic: postgres ssl client certificate authentification Thread-Index: AdfB2b4GgBg6jeCyQa6tMFS9StVl1g== Date: Fri, 15 Oct 2021 15:32:25 +0000 Message-ID: <54285c6f118c4aa1b5b7a5bfc99bd840@zuerich.ch> Accept-Language: de-CH, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.7.48.250] Content-Type: multipart/alternative; boundary="_000_54285c6f118c4aa1b5b7a5bfc99bd840zuerichch_" MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_54285c6f118c4aa1b5b7a5bfc99bd840zuerichch_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, I am playing around with postgres ssl encryption. I am confused about clien= t certificate authentication: The second approach combines any authentication method for hostssl entries = with the verification of client certificates by setting the clientcert auth= entication option to verify-ca or verify-full. The former option only enfor= ces that the certificate is valid, while the latter also ensures that the c= n (Common Name) in the certificate matches the user name or an applicable m= apping. https://www.postgresql.org/docs/12/ssl-tcp.html I tried both configurations within my pg_hba.conf, one after another: hostssl all all 0.0.0.0/0 md5 clie= ntcert=3Dverify-ca hostssl all all 0.0.0.0/0 md5 clie= ntcert=3Dverify-full Unfortunately, my postgres server doesn't care about any client certificate= . I can do a SSL connection even without any certificate or wrong certificate= on the client side (located in the users home directory). [tstzwma@tstm27373 ~]$ psql 'host=3Dtstm49004 port=3D5900 dbname=3Dpcl_l222= user=3Dtest' Password: psql (10.17, server 9.6.21) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bit= s: 256, compression: off) Type "help" for help. pcl_l222=3D> Any idea? Thanks, Markus --_000_54285c6f118c4aa1b5b7a5bfc99bd840zuerichch_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi a= ll,

 

 

I am= playing around with postgres ssl encryption. I am confused about client ce= rtificate authentication:

 

 

<= quote>

The = second approach combines any authentication method for hostssl en= tries with the verification of client certificates by setting the clie= ntcert authentication option to verify-ca or verify-ful= l. The former option only enforces that the certificate is valid, while the l= atter also ensures that the cn (Common Name) in the certificate m= atches the user name or an applicable mapping.

<= /quote>

https://www.postgresql.org/docs/12/ssl-t= cp.html

 

 

I tr= ied both configurations within my pg_hba.conf, one after another:

host= ssl   all         &n= bsp;   all         &= nbsp;   0.0.0.0/0        =        md5  clientcert=3Dverify-ca<= /o:p>

host= ssl   all         &n= bsp;   all         &= nbsp;   0.0.0.0/0        =        md5  clientcert=3Dverify-full

 

 

Unfo= rtunately, my postgres server doesn't care about any client certificate.

I ca= n do a SSL connection even without any certificate or wrong certificate on = the client side (located in the users home directory).

 

 

[tst= zwma@tstm27373 ~]$ psql 'host=3Dtstm49004 port=3D5900 dbname=3Dpcl_l222 use= r=3Dtest'

Pass= word:

psql= (10.17, server 9.6.21)

SSL = connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 2= 56, compression: off)

Type= "help" for help.

 

pcl_= l222=3D>

 

 

Any = idea?

 

 

Than= ks, Markus

 

 

--_000_54285c6f118c4aa1b5b7a5bfc99bd840zuerichch_--