From 533c4544ea9e40947846ee3ed52b91d09d549eaa Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 6 Aug 2023 18:09:56 +1000 Subject: [PATCH] Use certifi on Windows and macOS --- gns3server/controller/appliance_manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/appliance_manager.py b/gns3server/controller/appliance_manager.py index e8c6c2cf..dd5e7555 100644 --- a/gns3server/controller/appliance_manager.py +++ b/gns3server/controller/appliance_manager.py @@ -16,12 +16,14 @@ # along with this program. If not, see . import os +import sys import json import uuid import asyncio import aiohttp import shutil import ssl +import certifi try: import importlib_resources @@ -47,7 +49,11 @@ class ApplianceManager: self._appliances = {} self._appliances_etag = None - self._sslcontext = ssl.create_default_context(cafile=get_cacert()) + self._sslcontext = None + if hasattr(sys, "frozen"): + cacert = certifi.where() + self._sslcontext = ssl.create_default_context(cafile=cacert) + log.info("Use CA certificate '{}' for SSL connections".format(cacert)) @property def appliances_etag(self):