-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
gnutls: add SSL_CERT_FILE #48317
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
Closed
Closed
gnutls: add SSL_CERT_FILE #48317
Changes from all commits
Commits
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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| From 53091092876e668a4c43a4944d1b821015dea7a3 Mon Sep 17 00:00:00 2001 | ||
| From: Yegor Timoshenko <yegortimoshenko@riseup.net> | ||
| Date: Wed, 17 Oct 2018 07:48:34 +0000 | ||
| Subject: [PATCH] Handle SSL_CERT_FILE environment variable | ||
|
|
||
| --- | ||
| lib/system/certs.c | 13 +++++++++++++ | ||
| 1 file changed, 13 insertions(+) | ||
|
|
||
| diff --git a/lib/system/certs.c b/lib/system/certs.c | ||
| index 53eb561d0..6adb960e3 100644 | ||
| --- a/lib/system/certs.c | ||
| +++ b/lib/system/certs.c | ||
| @@ -137,6 +137,19 @@ add_system_trust(gnutls_x509_trust_list_t list, | ||
| r += ret; | ||
| #endif | ||
|
|
||
| + char *env = secure_getenv("SSL_CERT_FILE"); | ||
| + | ||
| + if (env != NULL) { | ||
| + ret = | ||
| + gnutls_x509_trust_list_add_trust_file(list, | ||
| + env, | ||
| + crl_file, | ||
| + GNUTLS_X509_FMT_PEM, | ||
| + tl_flags, tl_vflags); | ||
| + if (ret > 0) | ||
| + r += ret; | ||
| + } | ||
| + | ||
| #ifdef DEFAULT_BLACKLIST_FILE | ||
| ret = gnutls_x509_trust_list_remove_trust_file(list, DEFAULT_BLACKLIST_FILE, GNUTLS_X509_FMT_PEM); | ||
| if (ret < 0) { | ||
| -- | ||
| 2.19.0 | ||
|
|
||
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.
Can you ask upstream to incorporate this patch? Even if they refuse to merge it, we still get a code review from them.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah, sure, I'll try. However, to make it upstreamable it should probably be under a configure option.
The patch is trivial though, this chunk looks exactly like
DEFAULT_TRUST_STORE_FILEabove it, other thansecure_getenvcall.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.
Why would it need to be behind a configure option?
Uh oh!
There was an error while loading. Please reload this page.
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.
From what I gather, upstream has been hostile to including this previously. So I have little faith for it to be included without it being explicitly enabled by a configure flag, if at all.
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.
Where was this proposed before?
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.
https://guix-devel.gnu.narkive.com/aUu3aCUl/patch-gnu-gnutls-configure-location-of-system-wide-trust-store
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 the actual upstream thread where the guix developers talked to gnutls. The gnutls people don't really argue against the patch, they just mention that they think using pkcs11 is a better idea. Not sure if that is applicable for us, if I understand that correctly that needs a central service (hard on non-nixos). But upstream never really said "no that patch is a no-go because...".
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 having a service would defeat the motivation we had in the first place.