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

From Graham Leggett
Subject Re: [PATCH] Log details for client certificate failures
Date
Msg-id 59BF2A64-05F6-4870-B7DB-3FE815682209@sharp.fm
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
On 01 Jul 2022, at 22:59, Jacob Champion <jchampion@timescale.com> wrote:

>> I added this to httpd a while back:
>>
>> SSL_CLIENT_CERT_RFC4523_CEA
>>
>> It would be good to interoperate.
>
> What kind of interoperation did you have in mind? Are there existing
> tools that want to scrape this information for observability?

This is for human troubleshooting.

> I think the CEA syntax might not be a good fit for this particular
> patch: first, we haven't actually verified the certificate, so no one
> should be using it to assert certificate equality (and I'm truncating
> the Issuer anyway, to avoid letting someone flood the logs). Second,
> this is designed to be human-readable rather than machine-readable.

This is what a CEA looks like:

{ serialNumber 400410167207191393705333222102472642510002355884, issuer rdnSequence:”CN=Foo UK G1,O=Foo,C=UK" }

Whitespace and escaping is important above.

When troubleshooting, you want a string like the above that you can cut and paste and search for in other systems and
logfiles. The verification status of the cert isn’t an issue at this point, you have a system in front of you where it
doesn’twork when it should, and you need to know exactly what’s connecting, not what you think you’re connecting to,
andyou need precise data. 

Please don’t invent another format, or try and truncate the data. This is a huge headache when troubleshooting.

Regards,
Graham
—




pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Making the subquery alias optional in the FROM clause
Next
From: Zhihong Yu
Date:
Subject: Re: Making the subquery alias optional in the FROM clause