lol

esniper: add support for CURL_CA_BUNDLE variable to fix SSL authentication errors

+29
+3
pkgs/applications/networking/esniper/default.nix
··· 10 10 11 11 buildInputs = [openssl curl]; 12 12 13 + # Add support for CURL_CA_BUNDLE variable. 14 + patches = [ ./find-ca-bundle.patch ]; 15 + 13 16 postInstall = '' 14 17 sed <"frontends/snipe" >"$out/bin/snipe" \ 15 18 -e "2i export PATH=\"$out/bin:${coreutils}/bin:${gawk}/bin:${bash}/bin:${which}/bin:\$PATH\""
+26
pkgs/applications/networking/esniper/find-ca-bundle.patch
··· 1 + diff -ubr '--exclude=*.o' esniper-2-27-0-orig/http.c esniper-2-27-0-patched/http.c 2 + --- esniper-2-27-0-orig/http.c 2012-02-06 22:04:06.000000000 +0100 3 + +++ esniper-2-27-0-patched/http.c 2012-07-27 10:54:20.893054646 +0200 4 + @@ -200,6 +200,9 @@ 5 + int 6 + initCurlStuff(void) 7 + { 8 + + /* Path to OpenSSL bundle file. */ 9 + + const char *ssl_capath=NULL; 10 + + 11 + /* list for custom headers */ 12 + struct curl_slist *slist=NULL; 13 + 14 + @@ -241,6 +244,12 @@ 15 + if ((curlrc = curl_easy_setopt(easyhandle, CURLOPT_COOKIEFILE, ""))) 16 + return initCurlStuffFailed(); 17 + 18 + + /* If the environment variable CURL_CA_BUNDLE is set, pass through its 19 + + * contents to curl. */ 20 + + if ((ssl_capath = getenv("CURL_CA_BUNDLE"))) 21 + + if ((curlrc = curl_easy_setopt(easyhandle, CURLOPT_CAINFO, ssl_capath))) 22 + + return initCurlStuffFailed(); 23 + + 24 + slist = curl_slist_append(slist, "Accept: text/*"); 25 + slist = curl_slist_append(slist, "Accept-Language: en"); 26 + slist = curl_slist_append(slist, "Accept-Charset: iso-8859-1,*,utf-8");