Skip to content

Add --ca-cert / PROOFLINE_CA_CERT to trust an extra PEM root - #61

Merged
mohsen1 merged 2 commits into
prooflinedev:mainfrom
gcassata74:feat/ca-cert
Nov 17, 2026
Merged

mohsen1 merged 2 commits into
prooflinedev:mainfrom
gcassata74:feat/ca-cert

Conversation

@gcassata74

@gcassata74 gcassata74 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Behind a TLS-inspecting proxy (Zscaler, Netskope, Palo Alto, mitmproxy, …) every command fails:

proofline: could not reach https://proofline.sh: error sending request for url (…)

The CLI trusts only its bundled public roots, and the proxy re-signs the connection with a private corporate root. SSL_CERT_FILE has no effect, so there is currently no way to use the CLI on such networks.

Change

A global --ca-cert FILE option, also read from PROOFLINE_CA_CERT:

  • reads a PEM file (a bundle with several certificates works too) and adds its certificates to the bundled roots of every client the process builds: the API client (Http::new) and the self-updater;
  • certificate and hostname verification stay on; nothing is replaced or disabled;
  • a missing, unreadable or certificate-free file is refused before any request, with the path in the message.

Same pattern as curl --cacert, NODE_EXTRA_CA_CERTS and REQUESTS_CA_BUNDLE.

Testing

  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked: all pass.
  • New unit tests in src/tls.rs (valid PEM, client builds with the root, missing file, file without certificates), using a test root in tests/fixtures/ca-cert.pem.
  • Manual, through mitmdump with a placeholder token:
Run Result
proxy, no --ca-cert error sending request (mitmproxy: unknown ca)
proxy, --ca-cert ~/.mitmproxy/mitmproxy-ca-cert.pem HTTP 401 from proofline.sh: TLS through the proxy succeeds
proxy, PROOFLINE_CA_CERT=… HTTP 401
proxy, unrelated root still refused
no proxy, --ca-cert … HTTP 401: bundled roots still trusted

Notes

  • The background update check started before argument parsing, and commands run later by installed Git hooks, see the root only through PROOFLINE_CA_CERT, not the flag.

Behind a TLS-inspecting corporate proxy every request failed with
"error sending request", because the CLI trusts only its bundled public
roots and the proxy re-signs connections with a private root.

The new global --ca-cert FILE (or PROOFLINE_CA_CERT) reads a PEM bundle
and adds its certificates to the bundled roots of every client the
process builds, the API client and the self-updater. Verification stays
on: the file adds roots, it never replaces them or disables checks. A
missing, unreadable or certificate-free file is refused before any
request.

@mohsen1 mohsen1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex

Reconciled with the current HTTP client: custom CAs extend the shared builder after native and Linux bundled roots, preserving verification. Both required jobs passed on this head, including PEM regressions.

@mohsen1
mohsen1 merged commit 7068985 into prooflinedev:main Nov 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants