Skip to content

Commit 67a7d5e

Browse files
shenpeng.sp0916claude
andcommitted
fix: pass --no-verify-ssl to version check and fix SSL_VERIFY env var
The version check (pypi.org query) was always using default SSL verification, even when --no-verify-ssl was passed. This caused startup errors for users behind corporate firewalls with self-signed certificates. Also fixes the SSL_VERIFY environment variable from "" to "false" so LiteLLM correctly recognizes it. Fixes #664 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5dc9490 commit 67a7d5e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

aider/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
519519
if not args.verify_ssl:
520520
import httpx
521521

522-
os.environ["SSL_VERIFY"] = ""
522+
os.environ["SSL_VERIFY"] = "false"
523523
litellm._load_litellm()
524524
litellm._lazy_module.client_session = httpx.Client(verify=False)
525525
litellm._lazy_module.aclient_session = httpx.AsyncClient(verify=False)
@@ -720,7 +720,9 @@ def get_io(pretty):
720720
return main(argv, input, output, right_repo_root, return_coder=return_coder)
721721

722722
if args.just_check_update:
723-
update_available = check_version(io, just_check=True, verbose=args.verbose)
723+
update_available = check_version(
724+
io, just_check=True, verbose=args.verbose, verify_ssl=args.verify_ssl
725+
)
724726
analytics.event("exit", reason="Just checking update")
725727
return 0 if not update_available else 1
726728

@@ -735,7 +737,7 @@ def get_io(pretty):
735737
return 0 if success else 1
736738

737739
if args.check_update:
738-
check_version(io, verbose=args.verbose)
740+
check_version(io, verbose=args.verbose, verify_ssl=args.verify_ssl)
739741

740742
if args.git:
741743
git_root = setup_git(git_root, io)

aider/versioncheck.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def install_upgrade(io, latest_version=None):
6161
return
6262

6363

64-
def check_version(io, just_check=False, verbose=False):
64+
def check_version(io, just_check=False, verbose=False, verify_ssl=True):
6565
if not just_check and VERSION_CHECK_FNAME.exists():
6666
day = 60 * 60 * 24
6767
since = time.time() - os.path.getmtime(VERSION_CHECK_FNAME)
@@ -75,7 +75,10 @@ def check_version(io, just_check=False, verbose=False):
7575
import requests
7676

7777
try:
78-
response = requests.get("https://pypi.org/pypi/aider-chat/json")
78+
response = requests.get(
79+
"https://pypi.org/pypi/aider-chat/json",
80+
verify=verify_ssl,
81+
)
7982
data = response.json()
8083
latest_version = data["info"]["version"]
8184
current_version = aider.__version__

0 commit comments

Comments
 (0)