Repository navigation
corretto: generate cacerts from cacert - #577594
Merged
Merged
Conversation
Assisted-by: Claude Code (Claude Fable 5.1) Assisted-by: Claude Code (Claude Opus 5.5)
28 of 37 tasks
rollf
approved these changes
Oct 23, 2026
rollf
left a comment
Contributor
There was a problem hiding this comment.
Thank for you looking into this. I am going to approve this because I don't want to further hinder merging this. However, can you please implement my suggested changes?
Comment on lines
+140
to
+143
| pushd "$NIX_BUILD_TOP/cacerts-gen" | ||
| JAVA_TOOL_OPTIONS="-Dkeystore.pkcs12.certProtectionAlgorithm=NONE -Dkeystore.pkcs12.macAlgorithm=NONE" \ | ||
| ${jre-generate-cacerts} ${jdk.home}/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt | ||
| popd |
Contributor
There was a problem hiding this comment.
Suggested change
| pushd "$NIX_BUILD_TOP/cacerts-gen" | |
| JAVA_TOOL_OPTIONS="-Dkeystore.pkcs12.certProtectionAlgorithm=NONE -Dkeystore.pkcs12.macAlgorithm=NONE" \ | |
| ${jre-generate-cacerts} ${jdk.home}/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt | |
| popd | |
| ( | |
| cd "$NIX_BUILD_TOP/cacerts-gen" | |
| JAVA_TOOL_OPTIONS="-Dkeystore.pkcs12.certProtectionAlgorithm=NONE -Dkeystore.pkcs12.macAlgorithm=NONE" \ | |
| ${jre-generate-cacerts} ${jdk.home}/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt | |
| ) |
(untested)
| gradleFlagsArray+=(-Pcorretto.extra_config="${extra_config}") | ||
| # Finally, *append* nix-corretto-version specific flags. They come last, | ||
| # so our --with-cacerts-file (see preBuild) overrides Corretto's own. | ||
| gradleFlagsArray+=(-Pcorretto.extra_config="${extra_config} --with-cacerts-file=$NIX_BUILD_TOP/cacerts-gen/cacerts") |
Contributor
There was a problem hiding this comment.
Suggested change
| gradleFlagsArray+=(-Pcorretto.extra_config="${extra_config} --with-cacerts-file=$NIX_BUILD_TOP/cacerts-gen/cacerts") | |
| gradleFlagsArray+=(-Pcorretto.extra_config="--with-cacerts-file=$NIX_BUILD_TOP/cacerts-gen/cacerts ${extra_config}") |
I think the last word should be given to the extra config.
irgolic
force-pushed
the
cacert/corretto
branch
from
October 23, 2026 11:43
16ac381 to
e3f41e9
Compare
irgolic
marked this pull request as draft
October 23, 2026 11:45
irgolic
marked this pull request as ready for review
October 23, 2026 11:47
Member
Author
|
Thanks, I've made the changes you requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #576543.
nixpkgs builds the Corretto JDKs,
corretto11tocorretto25, from source withdontConfigure = true. Thus, thepreConfigurestep ofopenjdk, which makeslib/security/cacertsfromcacert(#576518), is not done. Before this change, the Java trust store of Corretto has 146 certificates, and 43 of them are not incacert. This change makes a newcacertsfrom thecacertbundle withjre-generate-cacertsinpreBuild. Then it adds--with-cacerts-filefor this file to the start ofcorretto.extra_config.build.gradleputscorretto.extra_configafter the options of Corretto, andconfigureuses the last option. Thus, this option comes after the option of Corretto, and an option inextraConfigcomes after this option. The log ofconfigureshowschecking for cacerts file... /build/cacerts-gen/cacerts.Warning
AI Disclosure: Claude Code made the code change, the commit message and the first version of this pull request description. Claude Code used Claude Fable 5.1 and Claude Opus 5.5. I examined all of this work. Claude Code also wrote all of nix-cacert-harness. This pull request description is written in ASD-STE100 (Simplified Technical English), examined with memelint in
strictmode.Test
nix-cacert-harness examines the package before and after this change. A local copy of nixpkgs is not necessary. The other three Corretto versions get the same change from
mk-corretto.nix. The harness builds Corretto from source a maximum of two times, and each build is approximately 25 minutes long. Without--force-build, the harness does not do these long builds.Harness output: corretto21
The harness tests the package with the 14 certificate chains of the eMudhra incident, from https://emudhra.we-have-a-problem.com/ (only the certificates, not the keys). Before this change, the trust store of Corretto accepts all 14 chains (
accepted 14/14). Thus, it accepts the eMudhra intermediate certificates throughemSign ECC Root CA - G3and through the Sectigo cross-sign byAAA Certificate Services. After this change, the trust store accepts no chain (accepted 0/14). In the second part of the output, a small Java test sends one request to each of four test servers. The test usesHttpsURLConnectionand the default trust store. Before this change, the test connects to all four servers. After this change, the test connects to no server. The harness compares the certificates by their SHA-256 fingerprints, becausejre-generate-cacertsdoes not keep the usual aliases.Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.