fix: HSM configure_hsm.sh fails on OpenJDK 21 due to removed lib/ext#440
fix: HSM configure_hsm.sh fails on OpenJDK 21 due to removed lib/ext#440peterhaochen47 wants to merge 2 commits into
Conversation
- remove code that relies on old of date JVM: - The removed code even has comment saying so: "JVM 8 - WILL NOT WORK ON JVM 11" - The Java Extension Mechanism (lib/ext directory) was permanently removed in JEP 220 (Java 9). The configure_hsm.sh script was copying Luna HSM JSP libraries to $JAVA_HOME/lib/ext/, causing the pre-start hook to crash on the current openjdk_21.0 stemcell. - Remove the broken cp commands and instead set java.library.path via JAVA_TOOL_OPTIONS so the Luna native library is discoverable when an HSM encryption provider is configured. - for native .so loading — this is the standard Luna/PKCS#11 pattern on JDK 9+. TNZ-112110 ai-assisted=yes
acfe76c to
dbe0dd2
Compare
| %> | ||
|
|
||
| <% if p('credhub.encryption.providers').flatten.any? { |provider| provider['type'] == 'hsm' } %> | ||
| JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS} -Djava.library.path=/var/vcap/packages/luna-hsm-client-7.4/jsp/64" |
There was a problem hiding this comment.
What about /var/vcap/packages/luna-hsm-client-7.4/jsp/ (for LunaProvider.jar)? Do we not need to do something about it?
|
Cursor/Auto's analysis on LunaProvider.jar:
|
From https://thalesdocs.com/dpod/services/luna_cloud_hsm/extern/client_guides/Content/sdk/java/jsp_overview_install.htmTo configure Java 9+ for Luna JSP Add LunaProvider.jar to the Java classpath and specify the Luna Java library location (libLunaAPI.so in Unix based systems or LunaAPI.dll in Windows systems) in the Java library path. For example:
|
- Added the jar file path to the Java classpath. ai-assisted=yes TNZ-112110
bfc5662 to
8654128
Compare
remove code that relies on old of date JVM:
The Java Extension Mechanism (lib/ext directory) was permanently removed in JEP 220 (Java 9). The configure_hsm.sh script was copying Luna HSM JSP libraries to $JAVA_HOME/lib/ext/, causing the pre-start hook to crash on the current openjdk_21.0 stemcell.
Remove the broken cp commands and instead set java.library.path via JAVA_TOOL_OPTIONS so the Luna native library is discoverable when an HSM encryption provider is configured.
TNZ-112110
ai-assisted=yes