You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The openssl CLI command has a way to see if a certificate is valid or not:
openssl x509 -noout -checkend 0 -in ./ca.crt
I wish for a new property valid (boolean) to be added to an X509Certificate.
What alternatives have you considered?
Using await execFile('openssl', ...) but that is not ideal as I have to invoke a new process and also make sure that openssl exists in the system which it might not do in e.g. containers.
Ideally though there would be an output of validTo and validFrom that had proper JavaScript Date objects. That would make it possible to warn about expiry etc. in an easier way before it even happens.
Could we also add the format in which validTo and validFrom are returned in the documentation?
It's disappointing to have to navigate to source code to find an answer.
Activity
[-]Add a `validity` property to `X509Certificate`[/-][+]Add a `valid` property to `X509Certificate`[/+]lppedd commentedon Aug 16, 2024
Could we also add the format in which
validToandvalidFromare returned in the documentation?It's disappointing to have to navigate to source code to find an answer.
thernstig commentedon Aug 17, 2024
I wish they were returned as
Dateobject, but since that is a breaking change maybe a new property is needed.lppedd commentedon Aug 17, 2024
Seems like the linked PR will be merged soon.
However, not everyone has the luxury of adopting the newest version, so better docs would go a long way.
For future reference, you can find the format in test cases:
node/test/parallel/test-crypto-x509.js
Lines 97 to 98 in e4f61de