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 1ngYbe-0002Qw-Ub for pgsql-general@arkaria.postgresql.org; Mon, 18 Apr 2022 21:08:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngYbd-0004V0-Ra for pgsql-general@arkaria.postgresql.org; Mon, 18 Apr 2022 21:08:21 +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 1ngYbd-0004U5-Gv for pgsql-general@lists.postgresql.org; Mon, 18 Apr 2022 21:08:21 +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 1ngYbb-0008Rk-7E for pgsql-general@postgresql.org; Mon, 18 Apr 2022 21:08:20 +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 23IL8EUc2381851; Mon, 18 Apr 2022 17:08:14 -0400 From: Tom Lane To: Adrian Klaver cc: "Pete O'Such" , pgsql-general@postgresql.org Subject: Re: No psql md5 auth, psql 14.1 to PG 11 In-reply-to: References: Comments: In-reply-to Adrian Klaver message dated "Mon, 18 Apr 2022 13:30:17 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2381849.1650316094.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 18 Apr 2022 17:08:14 -0400 Message-ID: <2381850.1650316094@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 4/18/22 13:12, Pete O'Such wrote: >> I'm unable to authenticate with psql to a PG 11 database on server A >> from server B which has PG 14.1 installed.  So it's psql 14.1 not >> authenticating to PG 11.  Other clients can and do authenticate to the >> PG 11 database, it only seems to fail with the psql 14.1 client. >> >> The PG 11 server uses md5.  So is the PG 14.1, but I didn't expect that >> to matter for a straight psql connection plus interactive password entry. > My first thought was that is was a md5/scram-sha-256 issue but I'm not > sure how as both versions support both password types. I just checked the case here, and I can connect fine from psql 14 to a v11 server with a password stored in md5. So I'm not sure what's up either, but there has to be something off-the-beaten-path about this. Looking at the v14 code, the error message tells us that pg_password_sendauth failed, which has several possible explanations: * pqGetnchar failed, which'd imply a malformed server challenge message. Seems unlikely, if other clients can connect. * pg_md5_encrypt failed. Hard to believe ... unless the v14 psql is running on a FIPS-mode machine, which'd refuse all MD5 operations? * pqPacketSend failed, ie server disconnected after sending the challenge. Also seems doubtful. So my recommendation is to check for FIPS mode. If it's a recent Linux, what does "sysctl crypto.fips_enabled" say? (This theory also requires that v14 was built with openssl support.) FWIW, v15 will provide a more on-point error message in such cases. regards, tom lane