-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: use system CAs instead of bundled ones #8334
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One concern that I have with the use of the environment variables for this is that it is easily possible for a rogue module to overwrite the value for child processes. Obviously rogue modules running untrusted code is a completely different problem in and of itself but I'm not convinced that allowing the trust root to be modified in this way is something we should allow. I'm good with the command-line arguments because those are much more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell this is out of our control, the env vars come as part of the OpenSSl trust store feature. This env var is implemented by OpenSSL in https://github.com/nodejs/node/blob/master/deps/openssl/openssl/crypto/x509/by_file.c#L100, which also implies its an env var supported by pretty much every program that uses OpenSSL, unless they have their own built-in trust store (Node is unusual in this respect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell basically what @sam-github says, this is just documenting OpenSSL's environment usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this env var currently has no effect in Node.js, correct? This PR makes it so that this env var can be used? At the very least, we should document the potential risk of using it and point out that changing the value in
process.env
would have an impact on child processes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(EDIT: sorry, I mistyped that). What is the potential risk of allowing the user to decide for themselves what CAs they trust? Should we document the potential risk of having the certs compiled in... where its impossible for them to be changed if your sec policy requires it, such as on CA compromise?
To emphasize that the behaviour may be inherited, perhaps a note such as below would be OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasnell would my proposed text in https://github.com/nodejs/node/pull/8334/files#r97408670 address your concerns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand these concerns at all. These env. variables already apply for non-node programs and will continue to apply. This change does nothing for that. And warning "unauthorized code can affect child processes"??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know these vars are from OpenSSL, not just node, so do you, but our average user won't, so lets warn. Its easier to modify the PR to make everyone happy than to stall it longer. My suggested text doesn't include the phrase you quote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better and it's good enough for me to land.
@AdamMajer ... as @sam-github mentions, the issue is about making sure the average user knows what the impact of the options are, even if they are not already familiar with OpenSSL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AdamMajer Do you want to add the text, so I can land right away? I'm willing to add the text while landing, too, but since the commit will have your name on it I'd like an OK from you before adding anything.