Add native access JVM flag for Bouncy Castle FIPS on newer Java releases#645
Merged
Merged
Conversation
maximthomas
approved these changes
May 15, 2026
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.
Summary
This change suppresses the Java restricted method warning emitted by Bouncy Castle FIPS when running OpenDJ on newer Java versions:
The startup scripts now add
--enable-native-access=ALL-UNNAMEDautomatically when the configured JVM supports it.Changes
opendj-server-legacy/resource/bin/_script-util.sh.opendj-server-legacy/resource/bin/_script-util.bat.--enable-native-access=ALL-UNNAMED.OPENDJ_JAVA_ARGS.java --enable-native-access=ALL-UNNAMED --versionis not supported.Why
Bouncy Castle FIPS loads native code through
System.load. Recent Java releases warn about restricted native access and require explicit opt-in using--enable-native-access=ALL-UNNAMEDfor code running on the classpath / unnamed module.Without this flag, OpenDJ startup can produce noisy warnings today, and future Java releases may block the operation unless native access is explicitly enabled.
Compatibility
The new argument is added only after a successful JVM feature probe. This keeps existing installations compatible with Java versions that do not recognize
--enable-native-access.Validation
Performed local validation for the Unix startup helper:
Also verified:
--enable-native-access=ALL-UNNAMEDis appended when the JVM supports it.OPENDJ_JAVA_ARGS.IDE inspection reported no new errors in the modified Windows batch file. Existing shellcheck-style warnings in
_script-util.share unrelated to this change.