From 2e47f04a56b8dacc0da0cf5cdc1f594c8bb57ff5 Mon Sep 17 00:00:00 2001 From: Ilya Voronin Date: Sat, 14 Sep 2024 13:18:20 +0200 Subject: [PATCH 1/2] Fix CERTIFICATE_VERIFY_FAILED errors on macOS --- ai_diffusion/comfy_client.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ai_diffusion/comfy_client.py b/ai_diffusion/comfy_client.py index a943830461..0520703048 100644 --- a/ai_diffusion/comfy_client.py +++ b/ai_diffusion/comfy_client.py @@ -27,13 +27,8 @@ from . import resources, util if util.is_macos: - try: - import certifi # type: ignore - import os - - os.environ["SSL_CERT_FILE"] = certifi.where() - except Exception as e: - log.error(f"Error setting SSL_CERT_FILE on MacOS: {e}") + import os + os.environ["SSL_CERT_FILE"] = "/etc/ssl/cert.pem" @dataclass From 03e7ef575f9d3cb65c8729e35798b8fbdfb3c7c5 Mon Sep 17 00:00:00 2001 From: Ilya Voronin Date: Wed, 18 Sep 2024 00:17:50 +0200 Subject: [PATCH 2/2] set SSL_CERT_FILE on macOS only if not already defined --- ai_diffusion/comfy_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ai_diffusion/comfy_client.py b/ai_diffusion/comfy_client.py index 0520703048..6192cf9d42 100644 --- a/ai_diffusion/comfy_client.py +++ b/ai_diffusion/comfy_client.py @@ -28,7 +28,8 @@ if util.is_macos: import os - os.environ["SSL_CERT_FILE"] = "/etc/ssl/cert.pem" + if "SSL_CERT_FILE" not in os.environ: + os.environ["SSL_CERT_FILE"] = "/etc/ssl/cert.pem" @dataclass