Repository navigation
NMS-20625: Minion truststore loses the JDK CA certificates - #9178
Open
mershad-manesh wants to merge 3 commits into
Open
mershad-manesh wants to merge 3 commits into
mershad-manesh wants to merge 3 commits into
Conversation
marshallmassengill
requested changes
Nov 19, 2026
marshallmassengill
left a comment
Contributor
There was a problem hiding this comment.
Should this target foundation-2024?
-entrypoint.sh:450: the list-then-delete of an existing alias is now dead code, since the store is always fresh.
…r certs When minion-server-certs.env is used, the entrypoint copies the JDK cacerts with rsync before importing the listed certificates. cacerts is a symlink, and without -L rsync skips it while still exiting 0. keytool then creates a new truststore that holds only the configured certificates, so Minion no longer trusts any public CA. Copy the file the symlink points to with rsync -L and make the copy writable, since the system file is read-only and keytool could not save to it otherwise. Fail the entrypoint if either step fails, and define E_INIT_CONFIG, which the entrypoint already used but never set. The truststore is now a fresh copy on every start, so drop the check that deleted an alias before importing it. Skip blank lines, and fail with a clear message when a listed certificate file is missing or not readable, or when keytool cannot import it, for example because an alias is listed twice. Add a smoke test that mounts a certificate directory and checks the Minion truststore holds every JDK CA plus the configured certificate.
mershad-manesh
force-pushed
the
mem/NMS-20625
branch
from
November 19, 2026 19:40
d47e932 to
94ecfd9
Compare
mershad-manesh
changed the base branch from
foundation-2026
to
foundation-2024
November 19, 2026 19:40
marshallmassengill
requested changes
Nov 19, 2026
marshallmassengill
left a comment
Contributor
There was a problem hiding this comment.
One more:
- Entrypoint.sh:268: an alias listed twice in minion-server-certs.env now aborts startup with exit 127. The removed list-then-delete block tolerated that case. The new error message does name the cause; decide whether fatal is acceptable in a maintenance release... not sure on this one to be honest so may be worth a discussion/look.
This is more "if we're in here...":
- entrypoint.sh:260: while read certid silently skips a last line with no trailing newline (confirmed locally). This predates the PR; while read -r certid || [[ -n $certid ]] fixes it while the loop is being touched.
2 tasks done
An alias listed twice in minion-server-certs.env, or one with the same name as a JDK CA, made the import fail and stopped the Minion. Before this change the entrypoint deleted an existing entry and imported it again, so restore that check and log when an entry is replaced. A last line without a trailing newline was skipped; read it as well.
Contributor
Author
This issue should be resolved. |
marshallmassengill
previously approved these changes
Nov 19, 2026
Contributor
There was a problem hiding this comment.
- MinionServerCertsIT.java:98: the test only covers the happy path; neither round-2 fix is exercised. Writing CERT_ALIAS + "\n" + CERT_ALIAS with no trailing newline would cover the duplicate-alias path.... not really a blocker to me but if you want to fix it...
- entrypoint.sh:262: a CRLF minion-server-certs.env now fails as "missing or not readable" with the \r invisible in the message. Again... probably not a blocker.
…ixes Strip a trailing carriage return from each line so a file with Windows line endings does not fail with a missing-certificate error that hides the \r. The smoke test now uses a CRLF line, a repeated alias and a last line with no trailing newline.
This branch has not been deployed
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.
When minion-server-certs.env is used, the entrypoint copies the JDK cacerts with rsync before importing the listed certificates. cacerts is a symlink, and without -L rsync skips it while still exiting 0. keytool then creates a new truststore that holds only the configured certificates, so Minion no longer trusts any public CA.
All Contributors
External References