From e92d0561ab162c99f44df6cafdb3cbac93c4d4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Thu, 2 Jun 2022 04:57:53 -0300 Subject: [PATCH] fix SSL Cert issue --- build_debug.bat | 2 ++ main.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 build_debug.bat diff --git a/build_debug.bat b/build_debug.bat new file mode 100644 index 0000000..6eb4537 --- /dev/null +++ b/build_debug.bat @@ -0,0 +1,2 @@ +windres --input=GZDoomUpdater.rc --output=GZDoomUpdater.res --output-format=coff +g++.exe -Wextra -Wall -fexceptions -Wno-unused -fno-strict-aliasing -municode -std=c++17 -Wno-uninitialized -g util.cpp json.cpp main.cpp -lversion -lshlwapi -lcurl -lzip -mwindows -o GZDoomUpdater.exe GZDoomUpdater.res diff --git a/main.cpp b/main.cpp index 13667b8..d369c7b 100644 --- a/main.cpp +++ b/main.cpp @@ -141,9 +141,12 @@ static VersionTriplet getLatestVersion(){ curl_easy_setopt(curl,CURLOPT_ACCEPT_ENCODING,"application/vnd.github.v3+json"); curl_easy_setopt(curl,CURLOPT_NOPROGRESS,0L); + curl_easy_setopt(curl,CURLOPT_SSL_OPTIONS,CURLSSLOPT_NATIVE_CA); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION,1L); - if(curl_easy_perform(curl)!=CURLE_OK){ + int err = curl_easy_perform(curl); + if(err != CURLE_OK){ //curl_easy_perform failed -- no internet? return (VersionTriplet){0,0,0}; } @@ -337,6 +340,8 @@ static void downloaderThreadProc(){ curl_easy_setopt(curl,CURLOPT_MAXREDIRS,50L); + curl_easy_setopt(curl,CURLOPT_SSL_OPTIONS,CURLSSLOPT_NATIVE_CA); + int err=curl_easy_perform(curl); if(err!=CURLE_OK){