mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02:00
Use certifi on Windows and macOS
This commit is contained in:
parent
04a302a389
commit
533c4544ea
@ -16,12 +16,14 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import asyncio
|
import asyncio
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import shutil
|
import shutil
|
||||||
import ssl
|
import ssl
|
||||||
|
import certifi
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import importlib_resources
|
import importlib_resources
|
||||||
@ -47,7 +49,11 @@ class ApplianceManager:
|
|||||||
|
|
||||||
self._appliances = {}
|
self._appliances = {}
|
||||||
self._appliances_etag = None
|
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
|
@property
|
||||||
def appliances_etag(self):
|
def appliances_etag(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user