Skip to content

Add AdditionalCACerts to Configuration.Build - #3639

Open
jwong-beep wants to merge 3 commits into
masterfrom
additional-ca-certs
Open

jwong-beep wants to merge 3 commits into
masterfrom
additional-ca-certs

Conversation

@jwong-beep

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

Copy link
Copy Markdown

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.

This new config option add the ability to connect to a MitM'ing proxy
@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
Author

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