-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: expose tls's x509 Certificate Object #29181
Comments
If anyone wants to take a crack at it, this would be reasonably straight-forward. The code to convert from an OpenSSL Line 1904 in 02c74e7
X509 object from js string/buffer data before converting to a js object.
|
We should have a unified way of accessing the key and its components for certificates and |
What if we took this idea a bit further and created an X509Store as well? Not only would we have a structured way of reading the properties of an X509, we could compose them into a store and then pass references to stores in the various parameters of the TLS module. e.g. pass an X509Store to Would provide a solid foundation for certificate handling in node.js going forward and also solve some of the performance issues relating to the parsing of string-formatted certificates on each request. |
Hi - Any update on this ticket please? It would be really useful! |
You can see that #30675 is a quick POC, but I make no promises about having the time to finish it. @RalphBragg If you want to pick it up, feel free to take that code and finish it, there's not much there and you are welcome to call it your own. |
Introduces the `crypto.X509Certificate` object. ```js const { X509Certificate } = require('crypto'); const x509 = new X509Certificate('{pem encoded cert}'); console.log(x509.subject); ``` Fixes: nodejs#29181 Signed-off-by: James M Snell <[email protected]>
Introduces the `crypto.X509Certificate` object. ```js const { X509Certificate } = require('crypto'); const x509 = new X509Certificate('{pem encoded cert}'); console.log(x509.subject); ``` Fixes: #29181 Signed-off-by: James M Snell <[email protected]> PR-URL: #36804 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
Is your feature request related to a problem? Please describe.
Several use-cases for getting x509 certificate information need to be solved by requiring an asn.1 module, defining the structure and undergoing slow, inefficient and error prone parsing.
Describe the solution you'd like
Seeing how you can already get parsed certificate information from a
tlsSocket
I wonder if an API like this could be exposedThe text was updated successfully, but these errors were encountered: