Skip to content

php.buildComposerProject2: use cacert for vendored composer/ca-bundle - #576561

Merged
philiptaron merged 2 commits into
NixOS:masterfrom
zimbatm:cacert-composer
Oct 21, 2026
Merged

philiptaron merged 2 commits into
NixOS:masterfrom
zimbatm:cacert-composer

Conversation

@zimbatm

@zimbatm zimbatm commented Oct 20, 2026

Copy link
Copy Markdown
Member

composer/ca-bundle ships its own res/cacert.pem (118 roots, including emSign ECC Root CA - G3). CaBundle::getSystemCaRootBundlePath() checks SSL_CERT_FILE, SSL_CERT_DIR, openssl.cafile/capath and well-known system paths first, and uses the vendored file only when none of them works, for example in a container or a build without cacert. That copy does not get cacert updates.

In the v2 composer install hook, replace every vendored composer/ca-bundle/res/cacert.pem with a symlink to the cacert bundle. This covers composer itself and the packages built with buildComposerProject2 that vendor composer/ca-bundle. The vendor fixed-output hashes do not change.

Not covered: apps that ship a .phar (for example wp-cli), packages not built with buildComposerProject2, and other vendored bundles such as rmccue/requests in n98-magerun2.

Tested on x86_64-linux with composer show -a monolog/monolog --no-cache:

Related to: #576485
Related to: #576541

Assisted-by: Claude Code (claude-opus-5)

Things done

composer/ca-bundle uses SSL_CERT_FILE, SSL_CERT_DIR, openssl.cafile and
well-known system paths first. If none of them is usable (for example a
container without /etc/ssl, or a sandbox without cacert), it uses its
vendored res/cacert.pem. That copy does not get cacert updates.

Replace it with a symlink to the cacert bundle.

Ref: NixOS#576541

Assisted-by: Claude Code (claude-opus-5)
Many PHP applications vendor composer/ca-bundle. It uses
SSL_CERT_FILE, SSL_CERT_DIR, openssl.cafile and well-known system
paths first. If none of them is usable (for example a container
without /etc/ssl, or a sandbox without cacert), it uses its vendored
res/cacert.pem. That copy does not get cacert updates.

Replace every vendored copy with a symlink to the cacert bundle in the
install hook. This also covers composer, so remove its own symlink.

Ref: NixOS#576541

Assisted-by: Claude Code (claude-opus-5)
@zimbatm zimbatm mentioned this pull request Oct 20, 2026
66 of 95 tasks
@nixpkgs-ci
nixpkgs-ci Bot requested a review from philiptaron October 20, 2026 21:51
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs 6.topic: php PHP is a general-purpose scripting language geared towards web development. labels Oct 20, 2026
@zimbatm zimbatm added the backport release-26.05 Backport PR automatically label Oct 20, 2026
@philiptaron
philiptaron added this pull request to the merge queue Oct 21, 2026
Merged via the queue into NixOS:master with commit cd371f2 Oct 21, 2026
33 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: php PHP is a general-purpose scripting language geared towards web development. 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. backport release-26.05 Backport PR automatically llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants