Skip to content

civicrm: use cacert bundle instead of vendored CA bundle - #578577

Merged
SuperSandro2000 merged 1 commit into
NixOS:masterfrom
irgolic:cacert/civicrm
Oct 27, 2026
Merged

SuperSandro2000 merged 1 commit into
NixOS:masterfrom
irgolic:cacert/civicrm

Conversation

@irgolic

@irgolic irgolic commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Part of #576541.

civicrm installs the totten/ca-config PHP library with a bundled CA file, vendor/totten/ca-config/src/CA/Config/cacert.pem. The output has two copies of this file, in $out/vendor and in $out/share/php/civicrm-core/vendor. Each copy has 137 certificates. In each copy, the harness finds 44 roots that are not TLS roots of cacert. Two of these roots are AAA Certificate Services and emSign ECC Root CA - G3. CRM/Utils/HttpClient.php and CRM/Core/Payment/PayPalImpl.php use CA_Config_Curl::probe. On Windows, this function gives the bundled file to curl. On Linux, it gives no CA file, and curl uses its default CA file. This change replaces the two installed files with symlinks to ${cacert}/etc/ssl/certs/ca-bundle.crt in postInstall.

Note

AI Disclosure: Claude Code made the code change, the commit message and the first version of this pull request description, with patchix. Claude Code used Claude Opus 5.5. This pull request description is written in ASD-STE100 (Simplified Technical English), examined with memelint in strict mode. As the automation/AI policy requires, I established confidence in this output: by manual review of the code change and of this description, and with the verification tooling that this description discloses.

Test

nix-cacert-harness examines the package before and after this change. A local copy of nixpkgs is not necessary.

nix run github:irgolic/nix-cacert-harness -- civicrm --pr 578577 --emudhra
Output of harness: civicrm
[1/2] static check + eMudhra chains: offline, reproducible
base (before) = dac5e22db3ed2be013da0eba8050c05140bd3f30
reference: fprs4zi8r6227x12qbsd1grvfrpz6201-nss-cacert-3.131.1 TLS roots=118 all=169
==================================================================
ATTR civicrm
before: dac5e22db3ed2be013da0eba8050c05140bd3f30   after: worktree <worktree>
before ok (0 built, 1s)
        drv /nix/store/f01k0bcrcxffxa7mg8xmmz4fncrfl2lj-civicrm-core-6.19.1.drv
after  ok (0 built, 2s)
        drv /nix/store/nl697jizi4b6bggxrdk4l9vn14i5h3wv-civicrm-core-6.19.1.drv

| output:path | before | after |
|---|---|---|
| out:/share/php/civicrm-core/vendor/totten/ca-config/src/CA/Config/cacert.pem | pem 137 certs: 26 not in cacert, 18 in cacert but not for TLS, 25 cacert TLS roots missing; scanner: AAA,ECC G3 | symlink->cacert:ca-bundle.crt pem 169 certs (118 TLS roots + 51 non-TLS, i.e. cacert's own trust-rules bundle) |
| out:/vendor/totten/ca-config/src/CA/Config/cacert.pem | pem 137 certs: 26 not in cacert, 18 in cacert but not for TLS, 25 cacert TLS roots missing; scanner: AAA,ECC G3 | symlink->cacert:ca-bundle.crt pem 169 certs (118 TLS roots + 51 non-TLS, i.e. cacert's own trust-rules bundle) |

cacert in runtime closure (before): no
cacert in runtime closure (after): yes
CAs trusted before but not trusted for TLS by cacert (44 total), e.g.:
  - C=GB, O=Comodo CA Limited, CN=AAA Certificate Services
  - C=IN, OU=emSign PKI, O=eMudhra Technologies Limited, CN=emSign ECC Root CA - G3
  - C=US, OU=emSign PKI, O=eMudhra Inc, CN=emSign ECC Root CA - C3
  - C=US, OU=emSign PKI, O=eMudhra Inc, CN=emSign Root CA - C1
  - C=AT, O=e-commerce monitoring GmbH, CN=GLOBALTRUST 2020
  - C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
  - C=BM, O=QuoVadis Limited, CN=QuoVadis Root CA 2
  - C=BM, O=QuoVadis Limited, CN=QuoVadis Root CA 3
  - C=CH, O=SwissSign AG, CN=SwissSign Gold CA - G2
  - C=CH, O=SwissSign AG, CN=SwissSign Silver CA - G2
VERDICT civicrm: FIXED: before trusted CAs outside cacert; after: 2 store(s) == cacert, none with extra CAs

eMudhra chains (--emudhra; offline and reproducible): the 14 chains in fixtures/emudhra,
each leaf verified against each store (openssl verify -purpose sslserver, at 2026-10-23):
| output:path | before | after |
|---|---|---|
| out:/share/php/civicrm-core/vendor/totten/ca-config/src/CA/Config/cacert.pem | pem: accepted 14/14 (g3: 7/7, aaa: 7/7, noct: 2/2) | symlink->cacert:ca-bundle.crt pem: accepted 0/14 |
| out:/vendor/totten/ca-config/src/CA/Config/cacert.pem | pem: accepted 14/14 (g3: 7/7, aaa: 7/7, noct: 2/2) | symlink->cacert:ca-bundle.crt pem: accepted 0/14 |
VERDICT civicrm emudhra: FIXED: before accepted 14/14 compromised eMudhra chains (g3: 7/7, aaa: 7/7, noct: 2/2); after 0/14

[2/2] live eMudhra test hosts: needs network, NOT reproducible offline
(no shims/civicrm.{nix,sh} or shims/live/civicrm.{nix,sh}: live check skipped)

Before this change, each of the two bundled files accepts all 14 eMudhra chains. After this change, the two files are the cacert bundle, and they accept none of the 14 chains. The harness has no live test for this package.

Things done

Assisted-by: Claude Code (Claude Opus 5.5) with patchix
@irgolic irgolic added the 1.severity: security Issues which raise a security issue, or PRs that fix one label Oct 25, 2026
@zimbatm zimbatm mentioned this pull request Oct 25, 2026
66 of 95 tasks
@nixpkgs-ci
nixpkgs-ci Bot requested a review from sorooris October 25, 2026 00:56
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. llm-assisted Contributions that include code generation with LLMs labels Oct 25, 2026
@SuperSandroBot

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (b97195b)

Command: nixpkgs-review pr 578577
Commit: 500cec8bf4181b2cae5492574ca00c70ff6461b0 (subsequent changes)
Merge: 3925879e81944342aa3e69a2610ceaf64bca457d

Logs: https://github.com/SuperSandro2000/nixpkgs-review-gha/actions/runs/40537775707/attempts/1


x86_64-linux

✅ 1 package built:
  • civicrm

aarch64-linux

✅ 1 package built:
  • civicrm

@SuperSandro2000
SuperSandro2000 added this pull request to the merge queue Oct 27, 2026
Merged via the queue into NixOS:master with commit 9aebec4 Oct 27, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: security Issues which raise a security issue, or PRs that fix one 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants