pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Gustavsson Mikael <mikael.gustavsson@smhi.se>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: Svensson Peter <peter.svensson@smhi.se>
Subject: Re: Problem with ssl and psql in Postgresql 13
Date: Wed, 23 Dec 2020 16:56:07 -0500
Message-ID: <740093.1608760567@sss.pgh.pa.us> (raw)
In-Reply-To: <20201223214534.GS27507@tamriel.snowman.net>
References: <89909.1608222331@sss.pgh.pa.us>
	<61e2a65bbc2f47d297a6f3cdac2cc6cc@smhi.se>
	<d3ab9042bce34aae85d323d69e3ee430@smhi.se>
	<169637.1608321770@sss.pgh.pa.us>
	<c347c62b507743ceac0aaebd0ccff533@smhi.se>
	<de4dc5a4f22d43a28300bccb70d99db6@smhi.se>
	<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>

Stephen Frost <sfrost@snowman.net> 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





view thread (17+ messages)  latest in thread

Message-ID: <740093.1608760567@sss.pgh.pa.us>
Permalink:  ../740093.1608760567@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/740093.1608760567@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, mikael.gustavsson@smhi.se, magnus@hagander.net, horikyota.ntt@gmail.com, peter.svensson@smhi.se
  Subject: Re: Problem with ssl and psql in Postgresql 13
  In-Reply-To: <740093.1608760567@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox