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 1lorri-0007DT-OX for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 18:14:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lorrh-0008SF-Ff for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jun 2021 18:14:45 +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 1lorrh-0008S7-83 for pgsql-hackers@lists.postgresql.org; Thu, 03 Jun 2021 18:14:45 +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 1lorrf-0005p0-AU for pgsql-hackers@postgresql.org; Thu, 03 Jun 2021 18:14:44 +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 153IEfq2015937; Thu, 3 Jun 2021 14:14:41 -0400 From: Tom Lane To: Peter Eisentraut cc: Jacob Champion , "pgsql-hackers@postgresql.org" Subject: Re: SSL SNI In-reply-to: <14840.1622742761@sss.pgh.pa.us> References: <7289d5eb-62a5-a732-c3b9-438cee2cb709@enterprisedb.com> <9407b344-7342-b2b7-004f-d5250687be42@enterprisedb.com> <4eaa2b56-c3d0-67b6-4716-010d001c7601@enterprisedb.com> <4bf3ae1c-b28e-8960-e89f-c390c5cf01a2@enterprisedb.com> <504c276ab6eee000bb23d571ea9b0ced4250774e.camel@vmware.com> <14368.1622742108@sss.pgh.pa.us> <14840.1622742761@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 03 Jun 2021 13:52:41 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15935.1622744081.1@sss.pgh.pa.us> Date: Thu, 03 Jun 2021 14:14:41 -0400 Message-ID: <15936.1622744081@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > It looks like the immediate problem can be resolved by just adding > a check for conn->pghost not being NULL, ... scratch that. There's another problem here, which is that this code should not be looking at conn->pghost AT ALL. That will do the wrong thing with a multi-element host list. The right thing to be looking at is conn->connhost[conn->whichhost].host --- with a test to make sure it's not NULL or an empty string. (I didn't stop to study this code close enough to see if it'll ignore an empty string without help.) regards, tom lane