From aa2ecdc2d9eaea6138be06a49129c453c95e1d76 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Mon, 8 Jan 2024 08:04:55 +1100 Subject: [PATCH] Remove CurlOption.ssl_verifypeer configuration * Remove CurlOption.ssl_verifypeer configuration which was added when developing the multi-threaded transfer handling and OpenSSL was causing issues due to insufficient file handles to open the read of the CA Certificate. If the SSL CA Certificate cannot be read, we should hard exit. --- src/main.d | 1 + src/onedrive.d | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.d b/src/main.d index e079aa57..f182e2b2 100644 --- a/src/main.d +++ b/src/main.d @@ -1287,6 +1287,7 @@ extern(C) nothrow @nogc @system void exitHandler(int value) { assumeNoGC ( () { addLogEntry("Got termination signal, performing clean up"); // Wait for all parallel jobs that depend on the database to complete + addLogEntry("Waiting for any existing upload|download process to complete"); taskPool.finish(true); // Was itemDb initialised? if (itemDB.isDatabaseInitialised()) { diff --git a/src/onedrive.d b/src/onedrive.d index a4552a70..061e2d3e 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -1665,10 +1665,10 @@ class OneDriveApi { // https://stackoverflow.com/questions/45829588/brew-install-fails-curl77-error-setting-certificate-verify // https://forum.dlang.org/post/vwvkbubufexgeuaxhqfl@forum.dlang.org - addLogEntry("Problem with reading the SSL CA cert via libcurl - attempting work around", ["debug"]); - curlEngine.setDisableSSLVerifyPeer(); - // retry origional call - performHTTPOperation(); + addLogEntry("Problem with reading the SSL CA cert via libcurl - please repair your system SSL CA Certificates"); + // Must force exit here, allow logging to be done. If needed later, we could re-use setDisableSSLVerifyPeer() + Thread.sleep(dur!("msecs")(500)); + exit(-1); } else { // Log that an error was returned addLogEntry("ERROR: OneDrive returned an error with the following message:");