Re: PQgetssl() and alternative SSL implementations

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: PQgetssl() and alternative SSL implementations
Дата
Msg-id CA+TgmoYrAH=o8m9959O_TgHm7OcK9C=f3WJfUHryb4pzu5uZ0A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PQgetssl() and alternative SSL implementations  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: PQgetssl() and alternative SSL implementations  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
On Wed, Jan 28, 2015 at 10:13 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> Here's a patch to implement the above scheme. It adds four functions to
> libpq, to interrogate the SSL status:
>
> int PQsslInUse(const PGconn *conn)
> Returns true (1) if the connection uses SSL, false (0) if not.
>
> const char *PQsslAttribute(const PGconn *conn, const char *attribute_name)
> Returns a piece of information. The list of attributes depends on the
> implementation, but there are a few that are expected to be supported by all
> of them. See docs for details.
>
> const char **PQsslAttributes(const PGconn *conn);
> Return an array of SSL attribute names available.
>
> void *PQsslStruct(const PGconn *conn, const char *struct_name)
> Return a pointer to an SSL-implementation specific object describing the
> connection. PQsslStruct(conn, "OpenSSL SSL") is equivalent to
> PQgetssl(conn).
>
> I think this is expandable enough, because you can easily add attributes
> later on, and different implementations can support different attributes. It
> contains the escape hatch for applications that need to do more, and have
> intimate knowledge of OpenSSL structs. It's also pretty easy to use.

I like it!

Although I think "OpenSSL SSL" is a little bit duplicatively
redundant.  Why not just "OpenSSL"?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: WITH CHECK and Column-Level Privileges
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: PQgetssl() and alternative SSL implementations