feat!: use OpenSSL instead of node-forge for DER-to-PEM conversion COMPASS-8073 #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit removes node-forge as a dependency and the conversion logic for X.509 certificates from DER to PEM format that we used it for, and replaces that logic with direct calls to OpenSSL functions (which are always available in Node.js).
The main downside of this approach is that it removes the ABI stability guarantees we get from Node-API and instead makes us dependent on the OpenSSL ABI as well. Currently, the functions used in this code are compatible with OpenSSL 1.1.x and 3.x, which should be good enough in the present and for at least a good number of years into the future.
The main upside of this approach is that it is significantly faster, and should enable applications that use this package to get the system certificate list to do so by default, rather than as an opt-in feature.