Re: SSL SNI
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jacob Champion <pchampion@vmware.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-06-07T09:54:31Z
Lists: pgsql-hackers
Attachments
- 0001-libpq-Fix-SNI-host-handling.patch (text/plain) patch 0001
On 03.06.21 20:14, Tom Lane wrote: > 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.) Patch attached. Empty host string was handled implicitly by the IP detection expression, but I added an explicit check for sanity. (I wasn't actually able to get an empty string to this point, but it's clearly better to be prepared for it.)
Commits
-
libpq: Fix SNI host handling
- 37e1cce4ddf0 14.0 landed
-
libpq: Set Server Name Indication (SNI) for SSL connections
- 5c55dc8b4733 14.0 landed