We are using spring boot 3.1.4 and Java 17 , while generating the private key by using the bouncy castle jdk18on getting error as below , The issue occurred only in open shift(Linux box) environment . Windows machine don't find any issue and also noticed "java.lang.IllegalStateException: zip file closed" while executing the SharedSecrets.getJavaUtilZipFileAccess
ERROR Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available
org.bouncycastle.openssl.PEMException: Unable to create OpenSSL PBDKF: PBKDF-OpenSSL SecretKeyFactory not available at org.bouncycastle.openssl.jcajce.PEMUtilities.getKey(Unknown Source) at org.bouncycastle.openssl.jcajce.PEMUtilities.getKey(Unknown Source) at org.bouncycastle.openssl.jcajce.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder$1$1.decrypt(Unknown Source) at org.bouncycastle.openssl.PEMEncryptedKeyPair.decryptKeyPair(Unknown Source) at
Comment From: wilkinsona
I suspect that this is a duplicate of https://github.com/spring-projects/spring-boot/issues/28837 although it's hard to be certain with the information provided. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: amalajone
The issue with Java 17 + Spring any version + Rhel8 Linux box .
I have tested the same piece of code with (Java 17 + Simple Java Class + Rhel8 Linux box) . working as expected .
Comment From: amalajone
@wilkinsona This issue blocking the Java 17 migration . Can you please prioritize the issue .
Comment From: philwebb
@amalajone Can you please provide the full output of java -version on the Rhel8 Linux box where the application fails. The sample alone isn't enough for us to tell what's going on. We need to run it using exactly the same java version.
Comment From: amalajone
Attached the screenshot
Comment From: philwebb
It's the HotSpot JVM so this is almost certainly a duplicate of #28837.
This issue blocking the Java 17 migration . Can you please prioritize the issue .
We are trying to fix the issue but it's unfortunately very involved. Your two options in the meantime are to either switch to OpenJDK or look at this workaround.