From 30daae2215d0c32e513ea615b35748322bc89724 Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 29 Jun 2022 08:24:40 -0700 Subject: [PATCH] Potential solution for TLS errors in OneFuzz (#2087) * proposed fix from here: https://github.com/Azure/azure-functions-durable-python/issues/194#issuecomment-710670377 * Update src/api-service/__app__/__init__.py Co-authored-by: George Pollard Co-authored-by: stas Co-authored-by: George Pollard Co-authored-by: George Pollard --- src/api-service/__app__/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/api-service/__app__/__init__.py b/src/api-service/__app__/__init__.py index e69de29bb2..91eac26c78 100644 --- a/src/api-service/__app__/__init__.py +++ b/src/api-service/__app__/__init__.py @@ -0,0 +1,17 @@ +import os + +import certifi.core + + +def override_where() -> str: + """overrides certifi.core.where to return actual location of cacert.pem""" + # see: + # https://github.com/Azure/azure-functions-durable-python/issues/194#issuecomment-710670377 + # change this to match the location of cacert.pem + return os.path.abspath( + "cacert.pem" + ) # or to whatever location you know contains the copy of cacert.pem + + +os.environ["REQUESTS_CA_BUNDLE"] = override_where() +certifi.core.where = override_where