aboutsummaryrefslogtreecommitdiff
Make libcurl respect the SSL_CERT_{DIR,FILE} variables by default. The variables
are fetched during initialization to preserve thread-safety (curl_global_init(3)
must be called when no other threads exist).

This fixes network functionality in rust:cargo, and probably removes the need
for other future workarounds.
===================================================================
--- curl-8.5.0.orig/lib/easy.c	2023-12-17 00:36:32.400468561 -0500
+++ curl-8.5.0/lib/easy.c	2023-12-17 00:39:08.898612331 -0500
@@ -137,6 +137,9 @@
 static char *leakpointer;
 #endif

+char * Curl_ssl_cert_dir = NULL;
+char * Curl_ssl_cert_file = NULL;
+
 /**
  * curl_global_init() globally initializes curl given a bitwise set of the
  * different features of what to initialize.
@@ -163,6 +166,9 @@
     goto fail;
   }

+  Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR");
+  Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE");
+
   if(!Curl_ssl_init()) {
     DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
     goto fail;
@@ -287,6 +293,9 @@
   Curl_ssl_cleanup();
   Curl_resolver_global_cleanup();

+  free(Curl_ssl_cert_dir);
+  free(Curl_ssl_cert_file);
+
 #ifdef _WIN32
   Curl_win32_cleanup(easy_init_flags);
 #endif
diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
--- curl-7.66.0.orig/lib/url.c	2020-01-02 15:43:11.883921171 +0100
+++ curl-7.66.0/lib/url.c	2020-01-02 16:21:11.563880346 +0100
@@ -524,6 +524,21 @@
     if(result)
       return result;
 #endif
+    extern char * Curl_ssl_cert_dir;
+    extern char * Curl_ssl_cert_file;
+    if(Curl_ssl_cert_dir) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
+            return result;
+    }
+
+    if(Curl_ssl_cert_file) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
+            return result;
+    }
   }
 
   set->wildcard_enabled = FALSE;
eme.scm (racket): Update to 7.6. [home-page]: Use HTTPS. * gnu/packages/patches/racket-store-checksum-override.patch: Adjust for 7.6. Pierre Neidhardt 2020-02-17gnu: slib: Use HTTPS home page....* gnu/packages/scheme.scm (slib)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2020-02-09gnu: chicken: Move to a separate module....* gnu/packages/scheme.scm (chicken): Move to chicken.scm. * gnu/packages/chicken.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Julien Lepiller <julien@lepiller.eu> Ekaitz Zarraga 2020-01-27gnu: sicp: Do not import module from the host Guile....This is a followup to 4144eb195c28cbfd1ca2a131cf4b64afcad713ae and 5e61de242156cdb3314abac168d9682ca7a4c28f. * gnu/packages/scheme.scm (sicp)[arguments]: Remove (srfi srfi-26) from #:modules. Ludovic Courtès 2020-01-27gnu: sicp: Remove unused module import....* gnu/packages/scheme.scm (sicp)[arguments]: Do not import (srfi srfi-1). Marius Bakke 2020-01-15gnu: gauche: Update to 0.9.9....* gnu/packages/scheme.scm (gauche): Update to 0.9.9. Tobias Geerinckx-Rice 2020-01-08gnu: gambit-c: Update to 4.9.3....* gnu/packages/scheme.scm (gambit-c): Update to 4.9.3. Tobias Geerinckx-Rice 2020-01-03gnu: femtolisp: Update to 0.0.0-2....* gnu/packages/scheme.scm (femtolisp): Update to 0.0.0-2. This commit revision patches several bugs. Brett Gilio 2019-12-24gnu: bigloo: Use HTTPS home page....* gnu/packages/scheme.scm (bigloo)[home-page]: Use HTTPS. Tobias Geerinckx-Rice 2019-12-24gnu: bigloo: Update to 4.3f....* gnu/packages/scheme.scm (bigloo): Update to 4.3f. Tobias Geerinckx-Rice 2019-11-01gnu: Chibi-Scheme: Do not use unstable tarball....* gnu/packages/scheme.scm (chibi-scheme)[source]: Change to GIT-FETCH. Marius Bakke 2019-11-01gnu: Chibi-Scheme: Update to 0.8....* gnu/packages/scheme.scm (chibi-scheme): Update to 0.8. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Ekaitz at ElenQ Technology 2019-09-23gnu: mit-scheme: Pass a valid tarball hash on non-x86....Fixes this bug: $ guix build -nd mit-scheme -s aarch64-linux guix build: error: derivation `/gnu/store/…-mit-scheme-c-10.1.3.tar.gz.drv' has incorrect output `/gnu/store/…-mit-scheme-c-10.1.3.tar.gz', should be `/gnu/store/…-mit-scheme-c-10.1.3.tar.gz' This is a followup to 7d6cfa442539e8fda0c145bf7a774c13e4fdc83c. * gnu/packages/scheme.scm (mit-scheme)[inputs]: For "source", pass a hash of the right length in the catch-all case. Ludovic Courtès 2019-06-11gnu: racket: Update to 7.3....* gnu/packages/scheme.scm (racket): Update to 7.3. * gnu/packages/patches/racket-store-checksum-override.patch: Update for Racket 7.3. Christopher Lemmer Webber 2019-04-29gnu: Remove scmutils....Fixes <https://bugs.gnu.org/34203>. * gnu/packages/scheme.scm (scmutils): Remove variable. Ricardo Wurmus