diff --git a/aider/main.py b/aider/main.py index 75e5f9bb9..f34907b8d 100644 --- a/aider/main.py +++ b/aider/main.py @@ -510,6 +510,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F litellm._load_litellm() litellm._lazy_module.client_session = httpx.Client(verify=False) litellm._lazy_module.aclient_session = httpx.AsyncClient(verify=False) + # Set verify_ssl on the model_info_manager + models.model_info_manager.set_verify_ssl(False) if args.timeout: models.request_timeout = args.timeout diff --git a/aider/models.py b/aider/models.py index 1532cdb1d..5a8196f72 100644 --- a/aider/models.py +++ b/aider/models.py @@ -138,7 +138,11 @@ class ModelInfoManager: self.cache_file = self.cache_dir / "model_prices_and_context_window.json" self.content = None self.local_model_metadata = {} + self.verify_ssl = True self._load_cache() + + def set_verify_ssl(self, verify_ssl): + self.verify_ssl = verify_ssl def _load_cache(self): try: @@ -154,8 +158,8 @@ class ModelInfoManager: try: import requests - # this needs to respect the --no-verify-ssl switch. ai! - response = requests.get(self.MODEL_INFO_URL, timeout=5) + # Respect the --no-verify-ssl switch + response = requests.get(self.MODEL_INFO_URL, timeout=5, verify=self.verify_ssl) if response.status_code == 200: self.content = response.json() try: