Re: [PATCH] Log details for client certificate failures

From: Jacob Champion <jchampion(at)timescale(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Log details for client certificate failures
Date: 2022-07-19 16:07:31
Message-ID: CAAWbhmiH2dPpRUnpS6pe9Fge--gj_az4ra2AJO1JvTKeiFuAug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 15, 2022 at 4:45 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2022-07-15 14:51:38 -0700, Jacob Champion wrote:
> > That seems much worse than escaping for this particular patch; if your
> > cert's Common Name is in (non-ASCII) UTF-8 then all you'll see is
> > "CN=?????????" in the log lines that were supposed to be helping you
> > root-cause. Escaping would be much more helpful in this case.
>
> I'm doubtful that's all that common.

Probably not, but the more systems that support it without weird
usability bugs, the more common it will hopefully become.

> But either way, I suggest a separate patch to deal with that...

Proposed fix attached, which uses \x-escaping for bytes outside of
printable ASCII.

Thanks,
--Jacob

Attachment Content-Type Size
0001-Don-t-reflect-unescaped-cert-data-to-the-logs.patch text/x-patch 18.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-07-19 16:14:32 Re: [PATCH] Log details for client certificate failures
Previous Message Andres Freund 2022-07-19 15:57:19 Re: NAMEDATALEN increase because of non-latin languages