I am trying to export a CSR via XML API as per this article and as per /debug output that I get when I perform the export via Web UI.
The request I run is as follows:
However this does not quite work - I get an error message that says:
Failed to prepare CSR <cert-name> for export. PKCS10 format can only be used with CSRs and not certificates.
I have now run out of ideas what it does not like in the request. The article explicitely says - "You can use the example above to export a certificate signing request (CSR). If you do so, then specify the following two parameters as shown: format - pkcs10, include-key - no" and this is exactly what I am doing. The debug out for a succefull operation suggests the same syntax:
<request cmd="op" cookie="1001040547321532"> <operations xml="yes"> <download> <certificate> <certificate-name>cert-name</certificate-name> <format>pkcs10</format> <include-####censored 'key''#### [2020/10/01 23:06:58] user=1001040547321532 Response took 0.040s <response status="success"><result><content encoding="base64">
<---encoded csr goes here--> ]]></content></result></response>
Has anybody has an idea about the correct format of the request?
Spoke to TAC (the engineer said he had been unable to reproduce), reproduced the issue for him, then we removed spaces from cert name and subject - the issue was gone, re-added the spaces - the issue did NOT re-occur. There must have been something else, very subtle, that trigerred the error. We'll keep playing with this and update this thread if manage to discover anything...
I got the same error message trying to export the CSR for an existing certificate. My guess is that only works for CSR objects and not for certificates. Works fine for me to export just the CSR without a certificate.
- Create the CSR
- Export the CSR
Should it work for a certificate as well?
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!