Skip to content

julia: use cacert bundle instead of vendored CA bundle - #578574

Merged
mdaniels5757 merged 1 commit into
NixOS:masterfrom
irgolic:cacert/julia
Oct 31, 2026
Merged

mdaniels5757 merged 1 commit into
NixOS:masterfrom
irgolic:cacert/julia

Conversation

@irgolic

@irgolic irgolic commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Part of #576541.

The Julia packages that generic.nix builds from source, julia_110 through julia_113, have a bundled CA file, share/julia/cert.pem. NetworkOptions.jl uses this file when JULIA_SSL_CA_ROOTS_PATH, SSL_CERT_FILE and SSL_CERT_DIR are not set and the system has no CA bundle, for example in build sandboxes and containers. Before this change, generic.nix uses cacert only during the build, and the installed cert.pem is the bundled file. For julia, this file has 121 certificates, and emSign ECC Root CA - G3 is one of them. This change replaces cert.pem with a symlink to the ca-bundle.crt file of cacert in postInstall. This is the same change as #577130 for the Julia binary packages.

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. The harness builds Julia from source after this change, and the install check of this build includes all of the Julia tests. This build is approximately 2 hours long, and approximately 13.5 GB of free space is necessary. Without --force-build, the harness does not do this build. The result of the Julia tests on the output of this change is SUCCESS (70193464 Pass, 448 Broken). The harness has no live test for julia, thus --shim julia-bin uses the live test of julia-bin, which is also correct for julia. --no-system-store hides the trust store of the system during the live test: the result then comes from the package only.

nix run github:irgolic/nix-cacert-harness -- julia --pr 578574 --emudhra --force-build --shim julia-bin --no-system-store
Output of harness: julia
$ nix run github:irgolic/nix-cacert-harness -- julia --base 8915027df75d0403ef013dd0cbf09ff3c602fd03 --after github:irgolic/nixpkgs/6662a5f54712919f60e96daec22e5812c338850e --emudhra --force-build --shim julia-bin --no-system-store
[1/2] static check + eMudhra chains: offline, reproducible
base (before) = 8915027df75d0403ef013dd0cbf09ff3c602fd03
reference: fprs4zi8r6227x12qbsd1grvfrpz6201-nss-cacert-3.131.1 TLS roots=118 all=169
==================================================================
ATTR julia
before: 8915027df75d0403ef013dd0cbf09ff3c602fd03   after: github:irgolic/nixpkgs/6662a5f54712919f60e96daec22e5812c338850e
before ok (0 built, 47s)
        drv /nix/store/…-julia-1.13.2.drv
after  ok (1 built, 7418s)
        drv /nix/store/…-julia-1.13.2.drv

| output:path | before | after |
|---|---|---|
| out:/share/julia/cert.pem | pem 121 certs: 3 not in cacert, 0 in cacert but not for TLS, 0 cacert TLS roots missing; scanner: 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 (3 total), e.g.:
  - 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
VERDICT julia: FIXED: before trusted CAs outside cacert; after: 1 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/julia/cert.pem | pem: accepted 7/14 (g3: 7/7, aaa: 0/7, noct: 1/2) | symlink->cacert:ca-bundle.crt pem: accepted 0/14 |
VERDICT julia emudhra: FIXED: before accepted 7/14 compromised eMudhra chains (g3: 7/7, aaa: 0/7, noct: 1/2); after 0/14

[2/2] live eMudhra test hosts: needs network, NOT reproducible offline
==================================================================
LIVE julia: needs network; NOT reproducible offline (the static and behavioral checks are)
before: 8915027df75d0403ef013dd0cbf09ff3c602fd03   after: github:irgolic/nixpkgs/6662a5f54712919f60e96daec22e5812c338850e
shim: shims/julia-bin.nix   hosts: https://<host>-emudhra.we-have-a-problem.com/, one request per host per side, 10s timeout
before ok (0 package drvs built, 2s)
        wrapper /nix/store/…-ca-live-julia
after  ok (0 package drvs built, 2s)
        wrapper /nix/store/…-ca-live-julia
system store: HIDDEN (--no-system-store: empty tmpfs over /etc/ssl /etc/pki, network unchanged)
control dv-g3b: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3b-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3b-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
control dv-g3c: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-emudhra.we-have-a-problem.com.pem (3 certs, valid for the host up to emSign ECC Root CA - G3), stock cacert rejects it
control dv-g3c-aaa: ok: HTTP 200, served chain == fixtures/emudhra/dv-g3c-aaa-emudhra.we-have-a-problem.com.pem (2 certs, valid for the host up to AAA Certificate Services), stock cacert rejects it
  before dv-g3b      CONNECTED      | status 200
  before dv-g3b-aaa  REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) while requesting https://dv-g3b-aaa-emudhra.we-have-a-pr
  before dv-g3c      CONNECTED      | status 200
  before dv-g3c-aaa  REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) while requesting https://dv-g3c-aaa-emudhra.we-have-a-pr
  after  dv-g3b      REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) while requesting https://dv-g3b-emudhra.we-have-a-proble
  after  dv-g3b-aaa  REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: certificate rejected (28) while requesting https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
  after  dv-g3c      REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) while requesting https://dv-g3c-emudhra.we-have-a-proble
  after  dv-g3c-aaa  REFUSED        | ERROR: RequestError: SSL certificate OpenSSL verify result: certificate rejected (28) while requesting https://dv-g3c-aaa-emudhra.we-have-a-problem.com/

julia  (live; before 8915027df75d0403ef013dd0cbf09ff3c602fd03, after github:irgolic/nixpkgs/6662a5f54712919f60e96daec22e5812c338850e)
         | dv-g3b         | dv-g3b-aaa     | dv-g3c         | dv-g3c-aaa
before   | CONNECTED      | REFUSED        | CONNECTED      | REFUSED
after    | REFUSED        | REFUSED        | REFUSED        | REFUSED
VERDICT julia live: PASS: before CONNECTED to 2/4 host(s) serving a compromised eMudhra chain (dv-g3b,dv-g3c); after REFUSED on all 4

The harness tests the package with the certificate chains of the eMudhra incident, from https://emudhra.we-have-a-problem.com/ (only the certificates, not the keys). Before this change, the bundled file accepts 7 of the 14 chains (accepted 7/14). Thus, the file accepts the eMudhra intermediate certificates through emSign ECC Root CA - G3, but not through AAA Certificate Services, because the file does not have this root. After this change, the file accepts no chain (accepted 0/14). In the second part of the output, a small Julia test sends one request to each of four test servers with Downloads.request. Julia uses a CA bundle in /etc/ssl before the bundled file, thus --no-system-store makes /etc/ssl and /etc/pki empty for this test. Before this change, the test connects to the two servers with the G3 chain. After this change, the test connects to no server.

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 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. llm-assisted Contributions that include code generation with LLMs 6.topic: julia Julia is a high-level, high-performance dynamic language for technical computing. labels Oct 25, 2026

@taranarmo taranarmo left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Local nixpkgs-review for julia_113 went fine, MozillaCACerts_ll resolves the link and Downloads.request works correctly

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 27, 2026
@mdaniels5757 mdaniels5757 added 4.workflow: backport This targets a stable branch backport release-26.05 Backport PR automatically and removed 4.workflow: backport This targets a stable branch labels Oct 31, 2026
@mdaniels5757

Copy link
Copy Markdown
Member

npb · 0902813 → 8059d2e

Expand this for a reproducible command.
npb --base 0902813ddfb7cc6c557221ac5b25c994e73cff9d --head 8915027df75d0403ef013dd0cbf09ff3c602fd03 --patch 8915027df75d0403ef013dd0cbf09ff3c602fd03...8059d2e61564eebe251f34ab69a4cbdda2eea8e1 -s x86_64-linux -s aarch64-linux -s aarch64-darwin
Expand this for a legend of all symbols below.
  • ✅ = successfully built
  • ❌ = failed to build
  • 🚫 = dependency failed to build
  • ❔ = couldn't try to build
  • ⏩ = failed to evaluate
  • ➖ = doesn't exist

x86_64-linux

✅ → ✅ · 6 packages (4 unique)
  • julia_110
  • julia_111
  • julia_112
  • julia = julia_113 = julia-stable

aarch64-linux

❌ → ❌ · 3 packages (1 unique)
  • julia = julia_113 = julia-stable
✅ → ✅ · 3 packages
  • julia_110
  • julia_111
  • julia_112

aarch64-darwin

❌ → ❌ · 5 packages (3 unique)
  • julia_110
  • julia_111
  • julia = julia_113 = julia-stable
✅ → ✅ · 1 package
  • julia_112

@mdaniels5757
mdaniels5757 added this pull request to the merge queue Oct 31, 2026
Merged via the queue into NixOS:master with commit 8fad3c9 Oct 31, 2026
39 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-26.05:

@github-actions github-actions Bot added the 8.has: port to stable This PR already has a backport to the stable release. label Oct 31, 2026
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 6.topic: julia Julia is a high-level, high-performance dynamic language for technical computing. 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 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.

3 participants