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 <porges@porg.es>

Co-authored-by: stas <statis@microsoft.com>
Co-authored-by: George Pollard <porges@porg.es>
Co-authored-by: George Pollard <gpollard@microsoft.com>
This commit is contained in:
Stas
2022-06-29 08:24:40 -07:00
committed by GitHub
parent 358c57a5b3
commit 30daae2215

View File

@ -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