fix(agent): trust public CA certs when downloading from Manage Server (v1.3.7) #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
primatekuntech/triton-install!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/agent-download-tls-public-ca"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Both
agent/get.ps1andagent/get.shpinned the binary-download connection (manage_server_url, typically HTTPS on 443) exclusively to the enrollment bundle's private CA. That's correct for the gateway connection (always self-signed by design — agents connect directly, no reverse proxy), but wrong for the admin/download connection: on a VPS deployment fronted by a reverse proxy with a real cert (e.g. Caddy + Let's Encrypt), that cert's chain never matches the bundle CA's thumbprint, so the download was rejected as untrusted even though it's a completely valid public certificate — blocking every VPS-with-a-domain install at the "downloading triton-agent from Manage Server" step.get.ps1: theSslStreamvalidation callback now falls back to Windows' own default trust verdict ($errors -eq [SslPolicyErrors]::None) when the bundle-CA pin doesn't match, instead of unconditionally returning$false.get.sh:curl --cacertreplaces curl's default CA bundle rather than adding to it, so there's no single-invocation equivalent of "trust this CA too." Addeddownload_from_manage_server(), which tries normal system trust first and falls back to--cacertwith the bundle CA — used at all 4 call sites (install, upgrade,--scanner-only, post-install scanner fetch).Self-signed/on-prem deployments are unaffected — the bundle-CA pin still matches first in that case; the new fallback only engages when the pin doesn't match.
Test plan
pwshsyntax parse ofget.ps1clean,PSScriptAnalyzerzero Error-severity findings (pre-existing Write-Host/unused-delegate-param warnings only)bash -nsyntax check ofget.shclean,shellcheck— zero new findings (same 14 pre-existing info-level SC2059 notes before/after)forgejo.primatekun.techconnection with an unrelated bundle CA → succeeds via public-trust fallback (the fix)🤖 Generated with Claude Code