mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: fall back to default certs when CA bundle path doesn't exist (#7352)
_resolve_verify() returned stale CA bundle paths from auth.json without checking if the file exists. When a user logs into Nous Portal on their host (where SSL_CERT_FILE points to a valid cert), that path gets persisted in auth.json. Running hermes model later in Docker where the host path doesn't exist caused FileNotFoundError bubbling up as 'Could not verify credentials: [Errno 2] No such file or directory'. Now _resolve_verify validates the path exists before returning it. If missing, logs a warning and falls back to True (default certifi-based TLS verification).
This commit is contained in:
parent
7e60b09274
commit
f72faf191c
2 changed files with 84 additions and 1 deletions
|
|
@ -1513,7 +1513,15 @@ def _resolve_verify(
|
|||
if effective_insecure:
|
||||
return False
|
||||
if effective_ca:
|
||||
return str(effective_ca)
|
||||
ca_path = str(effective_ca)
|
||||
if not os.path.isfile(ca_path):
|
||||
import logging
|
||||
logging.getLogger("hermes.auth").warning(
|
||||
"CA bundle path does not exist: %s — falling back to default certificates",
|
||||
ca_path,
|
||||
)
|
||||
return True
|
||||
return ca_path
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue