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 1ks706-0008S6-PE for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 16:28:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ks704-0003d6-35 for pgsql-general@arkaria.postgresql.org; Wed, 23 Dec 2020 16:28:32 +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 1ks703-0003cq-HH for pgsql-general@lists.postgresql.org; Wed, 23 Dec 2020 16:28:31 +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 1ks6zx-0003ZC-6K for pgsql-general@postgresql.org; Wed, 23 Dec 2020 16:28:30 +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 0BNGSLos723587; Wed, 23 Dec 2020 11:28:21 -0500 From: Tom Lane To: Gustavsson Mikael cc: Stephen Frost , Magnus Hagander , Kyotaro Horiguchi , "pgsql-general@postgresql.org" , Svensson Peter Subject: Re: SV: SV: SV: SV: Problem with ssl and psql in Postgresql 13 In-reply-to: References: <20201217.172938.170511532557914014.horikyota.ntt@gmail.com> <06191eae74d045e192a786a84a73ba53@smhi.se> <65644.1608214801@sss.pgh.pa.us> , <698125e1105644adaa27578bb37b18f6@smhi.se>,<89909.1608222331@sss.pgh.pa.us>,<61e2a65bbc2f47d297a6f3cdac2cc6cc@smhi.se> ,<169637.1608321770@sss.pgh.pa.us>, Comments: In-reply-to Gustavsson Mikael message dated "Wed, 23 Dec 2020 09:50:25 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <723585.1608740901.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Dec 2020 11:28:21 -0500 Message-ID: <723586.1608740901@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Gustavsson Mikael writes: > I did a final test before logging out for Christmas because i found a th= read in hackers discussing some issue with GSS and SSL. > So if i set gssencmode=3Ddisable on my pgsql-13 to postgres 13 server co= nnection i get an SSL connection. Oooh ... that's the missing ingredient. Do you have a GSS credentials cache on the client side, but no support on the server side? It looks like, if there is a credentials cache and gssencmode isn't explicitly disabled, we try GSS first. If the server refuses that: if (gss_ok =3D=3D 'N') { /* Server doesn't want GSSAPI; fall back if we can= */ if (conn->gssencmode[0] =3D=3D 'r') { appendPQExpBufferStr(&conn->errorMessage, libpq_gettext("server doe= sn't support GSSAPI encryption, but it was required\n")); goto error_return; } conn->try_gss =3D false; conn->status =3D CONNECTION_MADE; return PGRES_POLLING_WRITING; } that is, it decides the connection it has is good enough. This is not OK if SSL should have been used. regards, tom lane