java.security.ProviderException: Could not create trust object

162 views Asked by At

I have Java application running on two different servers. On the 1st server while the application is trying to insert a X.509 certificate to NSS keystore it is getting the following error:

Failed to store public key certificate in keystore. Cause: Could not create trust object
 java.security.ProviderException: Could not create trust object
        at sun.security.pkcs11.Secmod$TrustAttributes.<init>(Secmod.java:658)
        at sun.security.pkcs11.Secmod$Module.setTrust(Secmod.java:529)
        at sun.security.pkcs11.P11KeyStore.engineSetEntry(P11KeyStore.java:1045)
        at sun.security.pkcs11.P11KeyStore.engineSetCertificateEntry(P11KeyStore.java:516)
        at java.security.KeyStore.setCertificateEntry(Unknown Source)

Using certutil to list the NSS DB entry I can see the certificate entry, but the trust flag says "CTu,Cu,Cu".

On the 2nd server, inserting a X.509 certificate to NSS keystore doesn't throw the same exception. It is working fine and using certutil I can see the certificate entry, and the trust flag says: "CT,C,C".

My questions:

  1. Why on the 1st server inserting a X.509 certificate threw an exception?
  2. What cause the trust flag to be different between the two certificate? The X.509 certificate is imported thru the same API.

Both servers are running Java 8u121. Thank you.

0

There are 0 answers