Re: [PATCH] Log details for client certificate failures - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] Log details for client certificate failures
Date
Msg-id 20220719161432.qha3s76vyc6k4v5m@awork3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] Log details for client certificate failures  (Jacob Champion <jchampion@timescale.com>)
Responses Re: [PATCH] Log details for client certificate failures
List pgsql-hackers
Hi,

On 2022-07-19 09:07:31 -0700, Jacob Champion wrote:
> On Fri, Jul 15, 2022 at 4:45 PM Andres Freund <andres@anarazel.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.

I don't think this should be open coded in the ssl part of the code. IMO this
should replace the existing ascii escape function instead. I strongly oppose
open coding this functionality in prepare_cert_name().

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] Log details for client certificate failures
Next
From: Andres Freund
Date:
Subject: Re: Memory leak fix in psql