From 23b1a0ab70f190dbbb33dabb18ec039c7d85d6b3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 11 Jan 2020 23:51:49 +0300 Subject: Add implementation --- curl/curl/tool_main.c.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 curl/curl/tool_main.c.patch (limited to 'curl/curl/tool_main.c.patch') diff --git a/curl/curl/tool_main.c.patch b/curl/curl/tool_main.c.patch new file mode 100644 index 0000000..cae1787 --- /dev/null +++ b/curl/curl/tool_main.c.patch @@ -0,0 +1,55 @@ +--- curl/src/tool_main.c 2020-01-18 23:47:34.559751631 +0300 ++++ curl/tool_main.c 2020-01-20 16:07:17.183814044 +0300 +@@ -32,6 +32,10 @@ + #include + #endif + ++#include /* setenv(), _putenv() */ ++ ++#include ++ + #define ENABLE_CURLX_PRINTF + /* use our own printf() functions */ + #include "curlx.h" +@@ -138,6 +142,41 @@ static void memory_tracking_init(void) + */ + static CURLcode main_init(struct GlobalConfig *config) + { ++ /* Set the SSL_CERT_FILE environment variable to refer to the bundled CA ++ * certificates, unless it is already set, and switch to the OpenSSL ++ * backend. ++ */ ++ char* env = curlx_getenv ("SSL_CERT_FILE"); ++ ++ if (env == NULL) ++ { ++ int r; ++ ++#ifndef _WIN32 ++ r = setenv ("SSL_CERT_FILE", ca_certificates_file (), 0 /* overwrite */); ++#else ++ char* v = curl_maprintf ("SSL_CERT_FILE=%s", ca_certificates_file ()); ++ ++ if (v != NULL) ++ { ++ r = _putenv (v); ++ free (v); ++ } ++ else ++ r = -1; ++#endif ++ ++ if (r == -1) ++ return CURLE_FAILED_INIT; ++ } ++ else ++ curl_free (env); ++ ++ if (curl_global_sslset (CURLSSLBACKEND_OPENSSL, ++ NULL /* name */, ++ NULL /* avail */) != CURLSSLSET_OK) ++ return CURLE_FAILED_INIT; ++ + CURLcode result = CURLE_OK; + + #if defined(__DJGPP__) || defined(__GO32__) -- cgit v1.1