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 1oe0lU-0003ru-Nj for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Sep 2022 21:08:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oe0lT-0003kY-1E for pgsql-bugs@arkaria.postgresql.org; Thu, 29 Sep 2022 21:08:15 +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 1oe0lS-0003Vi-OJ for pgsql-bugs@lists.postgresql.org; Thu, 29 Sep 2022 21:08:14 +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 1oe0lN-0005Zp-JW for pgsql-bugs@lists.postgresql.org; Thu, 29 Sep 2022 21:08:11 +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 28TL87vt398500; Thu, 29 Sep 2022 17:08:07 -0400 From: Tom Lane To: Jacob Champion cc: heath.lord@crunchydata.com, Daniel Gustafsson , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17625: In PG15 PQsslAttribute returns different values than PG14 when SSL is not in use for the connection In-reply-to: <395956.1664484332@sss.pgh.pa.us> References: <17625-fc47c78b7d71b534@postgresql.org> <346263.1664480998@sss.pgh.pa.us> <360379.1664482591@sss.pgh.pa.us> <395956.1664484332@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 29 Sep 2022 16:45:32 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <398498.1664485687.1@sss.pgh.pa.us> Date: Thu, 29 Sep 2022 17:08:07 -0400 Message-ID: <398499.1664485687@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk BTW ... while I'm looking at this, it seems like PQsslAttributeNames is defined in a pretty schizophrenic way. It takes a "conn" argument but does nothing whatever with that argument. You get back OpenSSL's attribute list, or an empty attribute list, depending on compilation options but not on the properties of the connection. None of this is explained in the docs, and it would not scale to multiple supported libraries either. Should we clean that up while we're at it? A definition that'd be consistent with what we just agreed to for PQsslAttribute is: PQsslAttributeNames(NULL): the attributes for the default SSL library, or an empty list if there is none. PQsslAttributeNames(conn): the attributes for the SSL library in use on this connection, or an empty list if not encrypted. This doesn't cover how to find out the attributes for a non-default SSL library in advance of using it, but since PQsslAttribute would also need extension for multiple libraries, we could leave that for later. regards, tom lane