From d44ec04751c56decffa3edc1d5bd2171e67872ba Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 30 Apr 2018 15:36:55 +1000 Subject: [PATCH] add envvar to disable ssl verification --- anki/sync.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/anki/sync.py b/anki/sync.py index 2f5dfaa34..a77c4bb04 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -494,6 +494,13 @@ class AnkiRequestsClient: from anki import version return "Anki {}".format(version) +# allow user to accept invalid certs in work/school settings +if os.environ.get("ANKI_NOVERIFYSSL"): + AnkiRequestsClient.verify = False + + import warnings + warnings.filterwarnings("ignore") + class _MonitoringFile(io.BufferedReader): def read(self, size=-1): data = io.BufferedReader.read(self, HTTP_BUF_SIZE)