fix(auth): honor SSL CA env vars across httpx + requests callsites - #14533
Merged
Conversation
- hermes_cli/auth.py: add _default_verify() with macOS Homebrew certifi fallback (mirrors weixin 3a0ec1d). Extend env var chain to include REQUESTS_CA_BUNDLE so one env var works across httpx + requests paths. - agent/model_metadata.py: add _resolve_requests_verify() reading HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE in priority order. Apply explicit verify= to all 6 requests.get callsites. - Tests: 18 new unit tests + autouse platform pin on existing TestResolveVerifyFallback to keep its "returns True" assertions platform-independent. Empirically verified against self-signed HTTPS server: requests honors REQUESTS_CA_BUNDLE only; httpx honors SSL_CERT_FILE only. Hermes now honors all three everywhere. Triggered by Discord reports — Nous OAuth SSL failure on macOS Homebrew Python; custom provider self-signed cert ignored despite REQUESTS_CA_BUNDLE set in env.
teknium1
added a commit
that referenced
this pull request
Apr 24, 2026
Follow-up to PR #14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
nekorytaylor666
pushed a commit
to nekorytaylor666/hermes-agent
that referenced
this pull request
Apr 24, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
justrhoto
pushed a commit
to justrhoto/hermes-agent
that referenced
this pull request
Apr 24, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
donald131
pushed a commit
to donald131/hermes-agent
that referenced
this pull request
May 2, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
2 tasks
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…5049) Follow-up to PR NousResearch#14533 — applies the same _resolve_requests_verify() treatment to the one requests.get() site the PR missed (Codex OAuth chatgpt.com /models probe). Keeps all seven requests.get() callsites in model_metadata.py consistent so HERMES_CA_BUNDLE / REQUESTS_CA_BUNDLE / SSL_CERT_FILE are honored everywhere. Co-authored-by: teknium1 <teknium@hermes-agent>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes two related gaps in Hermes' SSL/TLS handling, both reported on Discord:
macOS Homebrew Python + Nous Portal OAuth: on macOS, Homebrew's OpenSSL cannot locate the system trust store, causing
CERTIFICATE_VERIFY_FAILEDagainst valid public certs. Extends the weixin fix (3a0ec1d) pattern to the shared_resolve_verify()helper inhermes_cli/auth.py.Custom providers with self-signed certs:
agent/model_metadata.py's rawrequests.get()calls for custom provider/v1/modelsendpoints accepted no explicitverify=argument, leaving SSL config torequests' implicit env var handling — which readsREQUESTS_CA_BUNDLEonly. Users who setSSL_CERT_FILEorHERMES_CA_BUNDLEwere silently ignored.Details
hermes_cli/auth.py_default_verify()helper: ondarwin, explicitly loadscertifi.where()into anssl.SSLContext; other platforms returnTrue(httpx default, which uses certifi via its own dependency)._resolve_verify()default and missing-CA fallback paths now return_default_verify()instead of rawTrue.REQUESTS_CA_BUNDLEto env var fallback chain — same env var now works for both httpx (_resolve_verify) and requests callsites.effective_insecureshort-circuit unchanged.agent/model_metadata.py_resolve_requests_verify()readingHERMES_CA_BUNDLE→REQUESTS_CA_BUNDLE→SSL_CERT_FILEin priority order, falling through toTruewhen none exist.verify=_resolve_requests_verify()to all 6requests.get()callsites in the module (including the/v1/modelsfetch at L630 that surfaced the custom-provider report).Empirical test (behind the change)
Verified against a self-signed HTTPS server that:
requestshonorsREQUESTS_CA_BUNDLEonly — ignoresSSL_CERT_FILEhttpxhonorsSSL_CERT_FILEonly — ignoresREQUESTS_CA_BUNDLEHermes now honors all three env vars consistently across both libs.
Behavior matrix
Never returns `False` from any default path. Only broadens what counts as a valid CA source.
Test plan
Related