| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
/cc @nodejs/crypto |
Sorry, something went wrong.
|
@AdamMajer Here typically Fixes: and full URIs are used when referencing issues to be closed :) Here’s a CI run: https://ci.nodejs.org/job/node-test-commit/4835/ |
Sorry, something went wrong.
|
@addaleax ah ,yes of couse. I'm completely new to NodeJS code review, but it seems that all commit messages have PR-URL: and Reviewed-By:. so is it correct to assume that once pull requests are reviewed, I amend the commit message with these extra headers (And fix my Fixes: header :)) ? |
Sorry, something went wrong.
|
@AdamMajer Usually, the person who lands the PR adds these review headers (the ones you named), but it’s not like there’s anything stopping you from adding PR-URL: https://github.com/nodejs/node/pull/8334 yourself. :) |
Sorry, something went wrong.
|
I know that @rvagg had suggested that this is best done as a configure option but I can definitely see value in this as a runtime command-line flag also -- even if left undocumented for the time being. |
Sorry, something went wrong.
|
Having it as runtime option is OK in rare situation, maybe if you need to specify multiple stores? But then can't that be done already with the environmental variables SSL_CERT_DIR and SSL_CERT_FILE? Enable this at compile time, then select various stores with environmental variables overriding OpenSSL defaults. That's how I understand it from quick grep through OpenSSL. An alternative would be to have compile time option "no-bundled-ca-certs" with runtime override option (no-)use-bundled-ca-certs (or something like that),
The idea behind compile time selection is to make like easier for Linux distributions (and their users) where bundled CAs are very bad idea. On Linux we definitely would not want to fallback to bundled CAs. But there are quite a per different permutations on how this can be done. |
Sorry, something went wrong.
|
Would this make it possible to use the Windows system cert store? |
Sorry, something went wrong.
|
Fixes #3159. Being able to specify a path to root CAs at may also be useful. I think that would be more suited as a runtime flag? |
Sorry, something went wrong.
There was a problem hiding this comment.
Let's prefix it NODE_, may be something like NODE_SYSTEM_CERT_STORE?
Sorry, something went wrong.
|
On 08/30/2016 05:15 PM, Douglas Wilson wrote:
For this better question would be, does OpenSSL support using Windows |
Sorry, something went wrong.
|
LGTM with a define naming nit, unless @bnoordhuis has some comments. |
Sorry, something went wrong.
For one, it would make it easier/possible to test this in CI :-) |
Sorry, something went wrong.
Yea, I have no idea, that's why I was asking :) Your config parameter along with it's description would suggest it does, and that it is not restricted to whatever OpenSSL happens to do. Some Googling suggests that no, OpenSSL cannot use the Windows cert store (but I have no idea how to verify those claims), which seems to make the configure switch misleading(?) |
Sorry, something went wrong.
|
Updated to use suggested define name. Minor change to comment, but otherwise same patch. The runtime option can be done later. The compile time option still needs to be there for 2 reasons,
One step at a time . |
Sorry, something went wrong.
|
LGTM. It's a shame that we don't have a direct way of testing this in CI since we can't set compile time flags for CI. I would say that this should likely be considered to be unsupported/experimental until it's gone through at least one release and we can see if any issues come up on it. |
Sorry, something went wrong.
There was a problem hiding this comment.
That's only going to be the case when node is linked against the distro openssl. It defaults to /usr/local/ssl with the bundled copy and that's unlikely to be the right path.
Aside: s/setup/set up/
Sorry, something went wrong.
There was a problem hiding this comment.
Actually, this does not appear to be the case. Look in openssl.gypi. I've tested this with OpenSUSE Leap 42.1 which needs bundled OpenSSL and it certainly uses the /etc/ssl path as defined in the openssl.gypi file.
Sorry, something went wrong.
There was a problem hiding this comment.
@bnoordhuis I agree with @AdamMajer here, node's copy of OpenSSL uses a cert path in /etc, not /usr/local
Sorry, something went wrong.
PR-URL: #8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
The pointer to std::vector is unnecessary, so replace it with standard instance. Also, make the for() loop more readable by using actual type instead of inferred - there is no readability benefit here from obfuscating the type. PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
NodeJS can already use an external, shared OpenSSL library. This library knows where to look for OS managed certificates. Allow a compile-time option to use this CA store by default instead of using bundled certificates. In case when using bundled OpenSSL, the paths are also valid for majority of Linux systems without additional intervention. If this is not set, we can use SSL_CERT_DIR to point it to correct location. Fixes: nodejs#3159 PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
The pointer to std::vector is unnecessary, so replace it with standard instance. Also, make the for() loop more readable by using actual type instead of inferred - there is no readability benefit here from obfuscating the type. PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
NodeJS can already use an external, shared OpenSSL library. This library knows where to look for OS managed certificates. Allow a compile-time option to use this CA store by default instead of using bundled certificates. In case when using bundled OpenSSL, the paths are also valid for majority of Linux systems without additional intervention. If this is not set, we can use SSL_CERT_DIR to point it to correct location. Fixes: nodejs#3159 PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
PR-URL: nodejs#8334 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Notable changes: * crypto: * ability to select cert store at runtime (Adam Majer) #8334 * Use system CAs instead of using bundled ones (Adam Majer) #8334 * deps: * upgrade npm to 4.1.2 (Kat Marchán) #11020 * upgrade openssl sources to 1.0.2k (Shigeki Ohtsu) #11021 * doc: add basic documentation for WHATWG URL API (James M Snell) #10620 * process: add NODE_NO_WARNINGS environment variable (cjihrig) #10842 * url: allow use of URL with http.request and https.request (James M Snell) #10638 PR-URL: #11062
Notable changes: * crypto: * ability to select cert store at runtime (Adam Majer) #8334 * Use system CAs instead of using bundled ones (Adam Majer) #8334 * deps: * upgrade npm to 4.1.2 (Kat Marchán) #11020 * upgrade openssl sources to 1.0.2k (Shigeki Ohtsu) #11021 * doc: add basic documentation for WHATWG URL API (James M Snell) #10620 * process: add NODE_NO_WARNINGS environment variable (cjihrig) #10842 * url: allow use of URL with http.request and https.request (James M Snell) #10638 PR-URL: #11062
|
@MylesBorins Is LTS interested in having this on 6.x? It would require backporting (along with #11007 which fixes up the docs) @sgallagher were you using node LTS when you thought the feature didn't exist, and PRed #11774 ? cc: @jasnell |
Sorry, something went wrong.
|
@sam-github Yes, we are on 6.10.0 in Fedora. I backported the patch manually and it's currently carried in our downstream packages. It would be convenient if it was maintained by upstream in 6.x, but not strictly required. |
Sorry, something went wrong.
|
@sgallagher I suspect (EDIT: "ed") it would be more useful to distros if backported. Can you PR your backport to node so Adam or I don't have to redo it? |
Sorry, something went wrong.
|
@sam-github Sure. It was nearly trivial, but see #11794 |
Sorry, something went wrong.
|
In Alpine Linux we are also on 6.10.0 now, I've used the patch from @sgallagher (thanks for it!). |
Sorry, something went wrong.
|
This was a while ago, but I'm curious if the runtime option ever got worked on? I have customers who install my app and I'd like for my app to use system-installed CAs on macOS. I think I'd have to build Node native module to access the certificates in Keychain Access, though, similar to how node-keytar does. Any tips for telling Node to use system certs on macOS at runtime? |
Sorry, something went wrong.
|
No work was done on Node.js side. You might want to ask on the openssl-users mailing list if OpenSSL has a mechanism for doing this. |
Sorry, something went wrong.
|
@sam-github Isn’t node --use-openssl-ca the “runtime option”? Did I miss anything? Sorry didn’t saw that @aguynamedben was asking for macOS and Keychain. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
crypto
Description of change
Use system supplied CAs instead of using Node's bundled version.
This is a compile time option with default reverting back to
using bundled certificates.
Also simplify cert_store lifetime by using reference count instead
of pulling it from under the SSL_CTX right before deletion. (merged)