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 1ksC7D-0002ey-ND for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 21:56:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ksC7C-0006u3-Hv for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 21:56:14 +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 1ksC7C-0006tw-Ah for pgsql-general@lists.postgresql.org; Wed, 23 Dec 2020 21:56:14 +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 1ksC78-0003Av-Py for pgsql-general@postgresql.org; Wed, 23 Dec 2020 21:56:13 +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 0BNLu7m4740094; Wed, 23 Dec 2020 16:56:07 -0500 From: Tom Lane To: Stephen Frost cc: Gustavsson Mikael , Magnus Hagander , Kyotaro Horiguchi , "pgsql-general@postgresql.org" , Svensson Peter Subject: Re: Problem with ssl and psql in Postgresql 13 In-reply-to: <20201223214534.GS27507@tamriel.snowman.net> References: <89909.1608222331@sss.pgh.pa.us> <61e2a65bbc2f47d297a6f3cdac2cc6cc@smhi.se> <169637.1608321770@sss.pgh.pa.us> <723586.1608740901@sss.pgh.pa.us> <737386.1608757126@sss.pgh.pa.us> <20201223211448.GR27507@tamriel.snowman.net> <738715.1608758847@sss.pgh.pa.us> <20201223214534.GS27507@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Wed, 23 Dec 2020 16:45:34 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <740092.1608760567.1@sss.pgh.pa.us> Date: Wed, 23 Dec 2020 16:56:07 -0500 Message-ID: <740093.1608760567@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> In the meantime, I did spot a code path that would explain the symptoms: >> pqsecure_open_gss() clears allow_ssl_try sooner than it oughta. If >> gss_wrap_size_limit() failed for some reason, we'd abandon the GSS >> connection and try another one, and we would *not* try to SSL-ify >> the new one. > There are certainly some very odd GSSAPI implementations out there > (including hacked up things particularly on Macs that we've seen..), > though I've not run into one where I've seen that call fail. The OP said he's on RHEL 8.3, so it ought to be mostly-stock Kerberos. I've just been digging through the SRPM to see if they'd done anything odd for FIPS mode or the like, and I'm not really finding anything. > If it did fail though, surely the error messages would make that > clear, and we're not seeing that here..? No, because we won't report the failure from gss_wrap_size_limit; we just discard that connection and try again. > I'm not sure how, but it sure seems like somehow, in this case, we're > going through the GSSAPI encryption code because we find GSSAPI > credentials (entirely possible, even if you're not using them for > talking to PG), the server responds with a "I haven't got support for > that" in some fashion, and we're skipping SSL at that point. How that's > happening isn't clear to me though, but the idea that it's because > gss_wrap_size_limit() is failing seems very unlikely. I already spent most of the day on theories like that, without any success. I agree that this theory seems quite unlikely, but you remember what Sherlock Holmes said. regards, tom lane