Prechádzať zdrojové kódy

file(UPLOAD): Add default ca_certs

Default ca_certs were not added when using `UPLOAD` with built-in
(non-system) cURL.  Previously we only did this for `DOWNLOAD`.

Fixes: #20551
Harry Mallon 5 rokov pred
rodič
commit
9427763081
1 zmenil súbory, kde vykonal 7 pridanie a 0 odobranie
  1. 7 0
      Source/cmFileCommand.cxx

+ 7 - 0
Source/cmFileCommand.cxx

@@ -2055,6 +2055,13 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
                            cmFileCommandCurlDebugCallback);
   check_curl_result(res, "UPLOAD cannot set debug function: ");
 
+  // make sure default CAInfo is set
+  std::string const& cainfo_err = cmCurlSetCAInfo(curl, nullptr);
+  if (!cainfo_err.empty()) {
+    status.SetError(cainfo_err);
+    return false;
+  }
+
   cmFileCommandVectorOfChar chunkResponse;
   cmFileCommandVectorOfChar chunkDebug;