Uh oh!
There was an error while loading. Please reload this page.
src: fix missing extra ca in tls.rootCertificates - #32075
Conversation
Fixes tls.rootCertificates missing certificates loaded from NODE_EXTRA_CA_CERTS. Fixes: nodejs#32074
addaleax
commented
Mar 3, 2020
@nodejs/crypto |
sam-github
commented
Mar 3, 2020
Seems reasonable to me. I don't think that adding a NL to the PEM is semver-major, particularly since PEM tooling is robust to extra NLs. In other words if people used to be adding a NL while concatenation certs and were getting "END X -----\n-----BEGIN ..." between certs and now get "END X -----\n\n-----BEGIN ...", IMO, the output is still within spec. All bug fixes have a non-zero chance of breaking code which depends on implementation details. |
ebickle
commented
Mar 4, 2020
Looks as though all of the node ASAN builds were failing across the node.js ecosystem when this PR was submitted. Doesn't appear to be related to this PR. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Moved X509ToPEM function to node_crypto.cc - Removed braces for single line statements - Modified X509ToPEM so that it throws crypto errors for unexpected OpenSSL errors
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Mar 9, 2020
addaleax
commented
Mar 11, 2020
Landed in 091444a |
Adds CAs from NODE_EXTRA_CA_CERTS to root_certs_vector in node_crypto.cc so that the extra certificates are always added to SecureContext instances. tls.rootCertificates restored to previous behavior of returning built-in Node.js certificates when --openssl-use-def-ca-store CLI option is set. Fixes: nodejs#32229Fixes: nodejs#32010 Refs: nodejs#32075
Adds CAs from NODE_EXTRA_CA_CERTS to root_certs_vector in node_crypto.cc so that the extra certificates are always added to SecureContext instances. tls.rootCertificates restored to previous behavior of returning built-in Node.js certificates when --openssl-use-def-ca-store CLI option is set. Fixes: nodejs#32229Fixes: nodejs#32010 Refs: nodejs#32075
Adds CAs from NODE_EXTRA_CA_CERTS to root_certs_vector in node_crypto.cc so that the extra certificates are always added to SecureContext instances. tls.rootCertificates restored to previous behavior of returning built-in Node.js certificates when --openssl-use-def-ca-store CLI option is set. Fixes: nodejs#32229Fixes: nodejs#32010 Refs: nodejs#32075
Fixes tls.rootCertificates missing certificates loaded from NODE_EXTRA_CA_CERTS.
Fixes: #32074
Potentially contains a semver-major breaking change. Change adheres to all existing specifications, but there is a non-zero risk that callers may have written code that does not expect changes to the contents of the
tls.rootCertificatesarray.tls.rootCertificatesnow includes certificate loaded fromNODE_EXTRA_CA_CERTSenvironment variable.tls.rootCertificatesis now terminated with a\nline break. This adheres to the PEM file format specification and is generally preferred - many non node.js systems fail if the line-break is not specified.Notes for code reviewers:
X509_STORE*to ensure thattls.rootCertificatesreflects the true certificates used bySecureContextand to avoid synchronizing/maintaining a separate variable innode_crypto.cc.X509ToPEMfunction was placed innode_crypto_common.ccsince it pairs with the existingX509ToObjectfunction.GetRootCertificatesfunction returns without setting a JavaScript return value when an unexpected error occurs (e.g. error callingPEM_write_bio_X509). This was done to remain consistent with the previous implementation ofGetRootCertificates.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes