Re: Adding support for SSLKEYLOGFILE in the frontend

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Tom Lane <tgl@sss.pgh.pa.us>, Jacob Champion <jacob.champion@enterprisedb.com>, Abhishek Chanda <abhishek.becs@gmail.com>, Álvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2025-06-27T09:15:02Z
Lists: pgsql-hackers

Attachments

> On 26 Jun 2025, at 23:06, Daniel Gustafsson <daniel@yesql.se> wrote:

> I'll propose changes for these comments in the morning when coffee has been
> had.

The attached moves to logging on stderr along with a test for this, and also
removes the WARNING prefix that was added to the other stderr loggings since
that seems out of place compared to other stderr loggings in libpq (the
sslpassword trunction WARNING is clearly warranted, these were not).  The umask
call is removed as it's not required, and a little bit of whitespace cleanup
from the original commit performed.  Re macros for file modes, this is for
fopen and not open though, or am I missing something?

--
Daniel Gustafsson

Commits

  1. Fix sslkeylogfile error handling logging

  2. Mark sslkeylogfile as Debug option

  3. libpq: Add support for dumping SSL key material to file