JDK-8237600 : Test SunJSSEFIPSInit fails on Ubuntu
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 11.0.6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2020-01-21
  • Updated: 2020-02-13
  • Resolved: 2020-02-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11.0.7 b03Fixed
Related Reports
Relates :  
Description
The test supposes that libnss3.so stays in /usr/lib64 which is not true at least for Ubuntu 16. The workaround to make test pass on Ubuntu:
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

----------System.out:(22/1871)----------
Exception in thread "main" java.security.ProviderException: Could not initialize NSS
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:217)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:112)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11$1.run(SunPKCS11.java:109)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.configure(SunPKCS11.java:109)
        at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:251)
        at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:242)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:242)
        at java.base/sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:222)
        at java.base/sun.security.jca.ProviderList.loadAll(ProviderList.java:315)
        at java.base/sun.security.jca.ProviderList.removeInvalid(ProviderList.java:332)
        at java.base/sun.security.jca.Providers.getFullProviderList(Providers.java:173)
        at java.base/java.security.Security.getProviders(Security.java:457)
        at SunJSSEFIPSInitClient.main(SunJSSEFIPSInitClient.java:31)
Caused by: java.io.IOException: nssLibDir must be a directory:/usr/lib64
        at jdk.crypto.cryptoki/sun.security.pkcs11.Secmod.initialize(Secmod.java:189)
        at jdk.crypto.cryptoki/sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:212)
        ... 14 more

Comments
URL: https://hg.openjdk.java.net/jdk-updates/jdk11u/rev/1ac2c2d8d002 User: clanger Date: 2020-02-13 06:08:22 +0000
13-02-2020

URL: https://hg.openjdk.java.net/jdk-updates/jdk11u-dev/rev/1ac2c2d8d002 User: mbalao Date: 2020-02-08 03:13:37 +0000
08-02-2020

Fix request (11u) We need to fix this test that affects 11u. No other release is currently affected because the test is 11u-only. Fix is trivial and only a test is under the scope. Review has been approved here: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-February/002472.html
06-02-2020

@Martin: I checked on Ubuntu 16.04.5 LTS and Ubuntu 18.04.3 LTS. Works good. Thanks!
06-02-2020

@Boris: Can you please test http://cr.openjdk.java.net/~mbalao/webrevs/8237600/8237600.webrev.00/ in Ubuntu 16.04.5 LTS?
05-02-2020

Thanks for the additional info. I will assign this to [~mbalao] who introduced this test.
22-01-2020

Yes, it is in openjdk, 11.0.6 update. The test was introduced here: https://hg.openjdk.java.net/jdk-updates/jdk11u/rev/b0436c181872 This is direct link to the test: https://hg.openjdk.java.net/jdk-updates/jdk11u/file/92ad8373cf4d/test/jdk/sun/security/pkcs11/fips/SunJSSEFIPSInit.java
22-01-2020

I can't find the SunJSSEFIPSInitClient.java test. Is this in OpenJDK? Please provide more information.
22-01-2020