unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob e8cda5bd96d09f73e6d833fc6208c996dc39f88d 1686 bytes (raw)
name: gnu/packages/patches/cmake-curl-certificates.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
By default commands such as "ctest" would not look for certificates
at all: <https://issues.guix.gnu.org/issue/37371>.

This changes CMake such that commands honor SSL_CERT_FILE and SSL_CERT_DIR
as well as /etc/ssl/certs.

FIXME: This shouldn't be necessary anymore, see libcurl-use-ssl-cert-env.patch

--- cmake-3.13.1/Source/cmCurl.cxx	2019-09-10 17:27:36.926907260 +0200
+++ cmake-3.13.1/Source/cmCurl.cxx	2019-09-10 17:52:35.475903919 +0200
@@ -2,11 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCurl.h"
 
-#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) &&                    \
-  !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
 #  define CMAKE_FIND_CAFILE
 #  include "cmSystemTools.h"
-#endif
 #include "cmStringAlgorithms.h"
 
 // curl versions before 7.21.5 did not provide this error code
@@ -30,6 +27,19 @@
     ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile);
     check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
   }
+
+  /* Honor the usual environment variables.  */
+  else if (cmSystemTools::GetEnv("SSL_CERT_FILE", e)) {
+    ::CURLcode res =
+      ::curl_easy_setopt(curl, CURLOPT_CAINFO, e.c_str());
+    check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
+  }
+  else if (cmSystemTools::GetEnv("SSL_CERT_DIR", e)) {
+    ::CURLcode res =
+      ::curl_easy_setopt(curl, CURLOPT_CAPATH, e.c_str());
+    check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
+  }
+
 #ifdef CMAKE_FIND_CAFILE
 #  define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt"
   else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) {

debug log:

solving e8cda5bd96 ...
found e8cda5bd96 in https://yhetil.org/guix-patches/20200114165921.epqysoaydxxqm5ye@zdrowyportier.kadziolka.net/
found 7fe2615271 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 7fe26152710027142bad9096efd9cfe552b09705	gnu/packages/patches/cmake-curl-certificates.patch

applying [1/1] https://yhetil.org/guix-patches/20200114165921.epqysoaydxxqm5ye@zdrowyportier.kadziolka.net/
diff --git a/gnu/packages/patches/cmake-curl-certificates.patch b/gnu/packages/patches/cmake-curl-certificates.patch
index 7fe2615271..e8cda5bd96 100644

Checking patch gnu/packages/patches/cmake-curl-certificates.patch...
Applied patch gnu/packages/patches/cmake-curl-certificates.patch cleanly.

index at:
100644 e8cda5bd96d09f73e6d833fc6208c996dc39f88d	gnu/packages/patches/cmake-curl-certificates.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).