Problem with certificate import on nuxeo 5.5

We have problem regarding import of a SSL certificate (.pfx).

For import of the certificate, we are using org.nuxeo.ecm.directory.api.DirectoryService and org.nuxeo.ecm.core.api.DocumentModel packages, further using:

certificate = session.createEntry(map);

where:

Map

ByteArrayOutputStream byteOS = new ByteArrayOutputStream(); String keystore64Encoded = Base64.encodeBytes(byteOS.toByteArray()); map.put(“keystore”, keystore64Encoded);

and session is an org.nuxeo.ecm.directory.Session and certificate is DocumentModel certificate.

The error we get in the log is the following:

org.nuxeo.ecm.directory.DirectoryException: createEntry failed

In case of trying to update an existing certificate, with newly generated we get the following error:

Exception during saving certificate.org.nuxeo.ecm.core.api.WrappedException: Exception: org.nuxeo.ecm.directory.DirectoryException. message: updateEntry failed for 'username'.

Can you please help us with some direction regarding this issue ?

Thank you very much in advance, A.

0 votes

1 answers

1540 views

ANSWER



Hi,

The “createEntry failed” error log is followed by a stack trace giving more details on the root cause.
You would also get much more details by setting a DEBUG log level on “org.nuxeo.ecm.directory”.

Same remarks about the update, even if I'm not sure how you can update something if the creation failed.

Did you write unit tests for validating your code? That would also help us to reproduce your issue if you could share those tests.

0 votes