From df8565493613128fbc0ad2e9cbf476d4481853c1 Mon Sep 17 00:00:00 2001
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: Sun, 14 Feb 2021 16:22:30 +0000
Subject: [PATCH] Revert "Use system sslcacertfile by default"

This reverts commit a4863b2f04adf25b9989bafbb9df21ea8b98a674.
---

Upstream issue: https://github.com/OfflineIMAP/offlineimap3/issues/41
Note: Temporary fix until upstream fixes it properly.


 offlineimap/repository/IMAP.py | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
index 56ebe74..06d77ab 100644
--- a/offlineimap/repository/IMAP.py
+++ b/offlineimap/repository/IMAP.py
@@ -296,15 +296,13 @@ class IMAPRepository(BaseRepository):
     def getsslcacertfile(self):
         """Determines CA bundle.
 
-        Returns path to the CA bundle.  It is explicitely specified or
-        requested via "OS-DEFAULT" value (and we will search known
-        locations for the current OS and distribution). If it is not
-        specified, we will search it in the known locations.
+        Returns path to the CA bundle.  It is either explicitely specified
+        or requested via "OS-DEFAULT" value (and we will search known
+        locations for the current OS and distribution).
 
-        If search route, via "OS-DEFAULT" or because is not specified,
-        yields nothing, we will throw an exception to make our callers
-        distinguish between not specified value and non-existent
-        default CA bundle.
+        If search via "OS-DEFAULT" route yields nothing, we will throw an
+        exception to make our callers distinguish between not specified
+        value and non-existent default CA bundle.
 
         It is also an error to specify non-existent file via configuration:
         it will error out later, but, perhaps, with less verbose explanation,
@@ -315,10 +313,7 @@ class IMAPRepository(BaseRepository):
         xforms = [os.path.expanduser, os.path.expandvars, os.path.abspath]
         cacertfile = self.getconf_xform('sslcacertfile', xforms, None)
         # Can't use above cacertfile because of abspath.
-        conf_sslacertfile = self.getconf('sslcacertfile', None)
-        if conf_sslacertfile == "OS-DEFAULT" or \
-                conf_sslacertfile is None or \
-                conf_sslacertfile == '':
+        if self.getconf('sslcacertfile', None) == "OS-DEFAULT":
             cacertfile = get_os_sslcertfile()
             if cacertfile is None:
                 searchpath = get_os_sslcertfile_searchpath()
-- 
2.30.0

