Re: Direct SSL connection with ALPN and HBA rules

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Direct SSL connection with ALPN and HBA rules
Дата
Msg-id 0b42d924-1740-41c4-a628-3e2211e6bbc4@iki.fi
обсуждение исходный текст
Ответ на Re: Direct SSL connection with ALPN and HBA rules  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Список pgsql-hackers
On 13/05/2024 16:55, Jelte Fennema-Nio wrote:
> On Mon, 13 May 2024 at 15:38, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>> Here's a patch to implement that.
> 
> +       if (conn->sslnegotiation[0] == 'd' &&
> +           conn->sslmode[0] != 'r' && conn->sslmode[0] != 'v')
> 
> I think these checks should use strcmp instead of checking magic first
> characters. I see this same clever trick is used in the recently added
> init_allowed_encryption_methods, and I think that should be changed to
> use strcmp too for readability.

Oh yeah, I hate that too. These should be refactored into enums, with a 
clear separate stage of parsing the options from strings. But we use 
that pattern all over the place, so I didn't want to start reforming it 
with this patch.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Matthias van de Meent
Дата:
Сообщение: Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts
Следующее
От: Robert Haas
Дата:
Сообщение: Re: cataloguing NOT NULL constraints