Skip to content

Add AdditionalCACerts to Configuration.Build - #3639

Merged
jwong-beep merged 5 commits into
masterfrom
additional-ca-certs
Oct 26, 2026
Merged

jwong-beep merged 5 commits into
masterfrom
additional-ca-certs

Conversation

@jwong-beep

@jwong-beep jwong-beep commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds a build.AdditionalCACerts config option: a list of PEM files containing CA certificates
to trust, in addition to the system trust store, for Please's own HTTPS downloads
(remote_file and self-update).

Restricted environments often route downloads through a caching proxy that terminates TLS so it
can cache HTTPS responses, or serve them from an internal mirror. Either way the certificates are
issued by a private CA, which Please can't currently verify. HTTPProxy handles plain forwarding
proxies but not this.

[build]
httpproxy = https://proxy.internal:3128
additionalcacerts = /etc/pki/internal-root.pem

Notes:

  • Only affects Please's internal downloads. Tools invoked by build rules (e.g. go mod download)
    use their own trust settings.
  • When HTTPProxy is set, fetchRemoteFile now modifies the default transport rather than
    replacing it with a bare http.Transport, so it keeps connection timeouts, connection pooling
    and HTTP/2.
  • A missing or invalid cert file fails remote_file targets. Self-update only logs a warning and
    falls back to the system trust store, since it runs on every invocation.
  • Tests: TestAdditionalCACerts runs a TLS server with a private cert and checks the download
    fails without the option and succeeds with it; TestTLSConfig covers the error cases.

@scyyx5

scyyx5 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Can you add more detail to the summary about why we want the additional CA?

@jwong-beep

jwong-beep commented Oct 22, 2026 via email

Copy link
Copy Markdown
Contributor Author

Comment thread src/core/config_test.go Outdated
Comment thread src/update/update.go Outdated
@jwong-beep
jwong-beep requested a review from peterebden October 23, 2026 15:46
@jwong-beep
jwong-beep merged commit a07c975 into master Oct 26, 2026
16 checks passed
@jwong-beep
jwong-beep deleted the additional-ca-certs branch October 26, 2026 12:20
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.

3 participants