From 4a6264cd7b03ea42e8c28c1f1f073a133d392ea8 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 25 Feb 2021 12:04:21 +0100
Subject: [PATCH] Fix the 'SSL peer certificate or SSH remote key was not OK'
 on Fedora.

Set CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to 0 for the
easy_perform, this is not ok in any way, but should works (be aware of
MITM attacks)
---
 src/module/module_repo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/module/module_repo.c b/src/module/module_repo.c
index b52ac104..ef60e625 100644
--- a/src/module/module_repo.c
+++ b/src/module/module_repo.c
@@ -235,8 +235,12 @@ __json_dl(const char *url, char **json)
     curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, __write_mem);
     curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA,     (void *) &file);
     curl_easy_setopt(curl_handle, CURLOPT_USERAGENT,     "libcurl-agent/1.0");
-    res = curl_easy_perform(curl_handle);
 
+    // 'SSL peer certificate or SSH remote key was not OK' on Fedora
+    curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
+    curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
+
+    res = curl_easy_perform(curl_handle);
     if (res != CURLE_OK) {
         LOG_ERROR("CURL", "curl_easy_perform failed on url %s: %s", url, curl_easy_strerror(res));
         goto err;
-- 
GitLab