Re: sslinfo extension - add notbefore and notafter timestamps
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Cary Huang <cary.huang@highgo.ca>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-03-20T14:28:47Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add notBefore and notAfter to SSL cert info display
- 6acb0a628ecc 17.0 landed
- 75ec5e7bec70 17.0 landed
-
Set fixed dates for test certificates validity
- 40fad96530ca 17.0 landed
On Wed, Mar 20, 2024 at 7:03 AM Daniel Gustafsson <daniel@yesql.se> wrote: > The issue here is that postgres use a different epoch from the unix epoch, so > any dates calcuated based on the unix epoch need to be adjusted. Ah, thank you! I had just reproduced Cary's problem and was really confused... > I've hacked > this up in the attached v11 using overflow-safe integer mul/add as proposed by > Jacob upthread (we really shouldn't risk overflowing an int64 here but there is > no harm in using belts and suspenders here as a defensive measure). > > The attached v11 is what I propose we go ahead with unless there further > comments on this. One last question: > + result -= ((POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY); > + return TimestampTzGetDatum(result); Is that final bare subtraction able to wrap around for dates far in the past? --Jacob