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 1oyawK-0000FZ-4p for pgsql-admin@arkaria.postgresql.org; Fri, 25 Nov 2022 15:48:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oyawJ-0002PJ-14 for pgsql-admin@arkaria.postgresql.org; Fri, 25 Nov 2022 15:48:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyawI-0002NX-Mk for pgsql-admin@lists.postgresql.org; Fri, 25 Nov 2022 15:48:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyawG-0005vY-It for pgsql-admin@lists.postgresql.org; Fri, 25 Nov 2022 15:48:29 +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 2APFmQ664056954; Fri, 25 Nov 2022 10:48:26 -0500 From: Tom Lane To: Laurenz Albe cc: Dhirendra Singh , pgsql-admin@lists.postgresql.org Subject: Re: Question about cert authentication method. In-reply-to: References: Comments: In-reply-to Laurenz Albe message dated "Fri, 25 Nov 2022 12:54:20 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <4056952.1669391306.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Nov 2022 10:48:26 -0500 Message-ID: <4056953.1669391306@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Fri, 2022-11-25 at 15:36 +0530, Dhirendra Singh wrote: >> I am expecting the connection to fail because user "test (S114546) does= not exist. but i am confused about the error message in the server log. >> It says certificate authentication failed=C2=A0 for user "test (S114546= )". but CN in the certificate matches with the user name in psql connectio= n request. >> So certificate authentication should pass. It should fail afterwards. > Well, "test" is different from "test (S114546)", so what do you expect? I think the OP is complaining about the message contents, not the fact of the failure. However, it's intentional that the message sent to the client is vague about the exact cause of an authentication failure. Otherwise we might be giving aid to a blackhat trying to break into the server. The postmaster log is supposed to be more specific, and it looks to me like what's in the log is accurate. regards, tom lane