From 96ff80271fce975c9f73972d2d413da08f7de82e Mon Sep 17 00:00:00 2001
From: Tino Mettler <tino+debian@tikei.de>
Date: Mon, 22 Jan 2018 19:42:29 +0100
Subject: [PATCH] Disable the usage of CA certificates if the user disables
 SSLVerifyServer and SSLVerifyHost

---
 src/syncevo/SoupTransportAgent.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/syncevo/SoupTransportAgent.cpp b/src/syncevo/SoupTransportAgent.cpp
index 9dd7f581..ed24a4b4 100644
--- a/src/syncevo/SoupTransportAgent.cpp
+++ b/src/syncevo/SoupTransportAgent.cpp
@@ -130,9 +130,14 @@ void SoupTransportAgent::send(const char *data, size_t len)
     // use CA certificates if available and needed,
     // otherwise let soup use system default certificates
     if (m_verifySSL) {
-        if (!m_cacerts.empty()) {
-            g_object_set(m_session.get(), SOUP_SESSION_SSL_CA_FILE, m_cacerts.c_str(), NULL);
-        }
+	    if (!m_cacerts.empty()) {
+		    g_object_set(m_session.get(), SOUP_SESSION_SSL_CA_FILE,
+				 m_cacerts.c_str(), NULL);
+	    }
+    } else {
+	    // Checking enabled by default, disable it.
+	    g_object_set(m_session.get(), SOUP_SESSION_SSL_STRICT, false,
+			 NULL);
     }
 
     soup_message_set_request(message.get(), m_contentType.c_str(),
