-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
git, openssl, curl: Respect $NIX_SSL_CERT_FILE #24121
Conversation
Slightly modified version of 942dbf8
@domenkozar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edef1c, @ikervagyok and @edolstra to be potential reviewers. |
+ if (getenv("NIX_SSL_CERT_FILE")) | ||
+ set_from_env(&ssl_cainfo, "NIX_SSL_CERT_FILE"); | ||
+ else | ||
+ set_from_env(&ssl_cainfo, "SSL_CERT_FILE"); |
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 should not appear here. Git does follow SSL_CERT_FILE by default. There is no reason to keep this line if we use NIX_SSL_CERT_FILE. Git uses openssl and without this override, the underlying openssl will look at SSL_CERT_FILE anyway.
tl;dr set_from_env(&ssl_cainfo, "SSL_CERT_FILE");
should not appear here.
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.
If so, NIX_SSL_CERT_FILE
is tried by the patched openssl as well...
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, it is.
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.
Anyway, NIX_SSL_CERT_FILE should be a default value, not a global override. If someone knows better than us where to look for the CA bundle, let them have it their way.
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.
In this case, SSL_CERT_FILE was introduced by #14617. There was not much investigation to understand the issue. Maybe it was due to some misconfigured openssl, Or this i really needed. Who knows... Anyway, it's NIX_SSL_CERT_FILE which is needed, not "SSL_CERT_FILE".
- env = curlx_getenv("SSL_CERT_FILE"); | ||
+ env = curlx_getenv("NIX_SSL_CERT_FILE"); | ||
+ if(!env) | ||
+ env = curlx_getenv("SSL_CERT_FILE"); |
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.
Same as above, let SSL_CERT_FILE return to its rank of default value if none provided. We now use "NIX_SSL_CERT_FILE" as first priority override.
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 think this is intentional because of Darwin #23605.
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.
Sorry, this one is correct because it is how curl works...
Fixes #23605
cc @edolstra @vcunat