From 59effa6800221ae301d1424d7504ff70e77b47f9 Mon Sep 17 00:00:00 2001 From: Lucas Gomide Date: Mon, 16 Jun 2025 12:10:44 -0300 Subject: [PATCH] fix: SSL error while getting LLM data from GH When running behind cloud-based security users are struggling to donwload LLM data from Github. Usually the following error is raised ``` SSL certificate verification failed: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /BerriAI/litellm/main/model_prices_and_context_window.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1010)'))) Current CA bundle path: /usr/local/etc///.pem ``` This commit ensures the SSL config is beign provided while requesting data --- src/crewai/cli/provider.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crewai/cli/provider.py b/src/crewai/cli/provider.py index 529ca5e26..0a26ef809 100644 --- a/src/crewai/cli/provider.py +++ b/src/crewai/cli/provider.py @@ -1,3 +1,5 @@ +import os +import certifi import json import time from collections import defaultdict @@ -163,8 +165,10 @@ def fetch_provider_data(cache_file): Returns: - dict or None: The fetched provider data or None if the operation fails. """ + ssl_config = os.environ['SSL_CERT_FILE'] = certifi.where() + try: - response = requests.get(JSON_URL, stream=True, timeout=60) + response = requests.get(JSON_URL, stream=True, timeout=60, verify=ssl_config) response.raise_for_status() data = download_data(response) with open(cache_file, "w") as f: