libpq ssl -> clear fallback looses error messages

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема libpq ssl -> clear fallback looses error messages
Дата
Msg-id 48EFE6D6.2000109@hagander.net
обсуждение исходный текст
Ответы Re: libpq ssl -> clear fallback looses error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I noticed while working on general fixes for the certificate handling
that if we have a connection being attempted with sslmode=prefer (which
happens to be our default), we will loose error messages.

Basically, if we fail the SSL connection, we will throw away the error
message and try a cleartext connection. Now, if the server is configured
to require SSL (using hostssl), you will get an error message that says
"there is no pg_hba, etc, SSL off". Which is totally misleading, because
I *tried* to connect with SSL, but failed.

If I set sslmode=require, the error message is properly reported.

AFAIK we don't actually have a way to pass back an intermediate result
here, but we really need to report this error *somehow*.

It may even be to the point that if we connect and get a client side SSL
error, we should just report it and abort, and only retry if the error
is actually a server error saying there is no pg_hba for SSL here?

(or I'm missing something obvious :-P)

//Magnus


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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: How is random_page_cost=4 ok?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Contrib, schema, and load_module