error updating the ssl certificate via curl

0

Hi,

when i try to update the ssl certificate via curl i get this message ...
<?xml version="1.0" encoding="ISO-8859-1"?>
<Response stat="422" code="fail">
<Error>Command Failed: Invalid Format Input</Error>
</Response>
 
the console command used is ...
curl -X POST --data-binary "c:\temp\file.combo.pem" -k "https://bal:pwd@x.x.x.x/access/addcert?cert=certificatename&replace=1"
 
The .pem file is correct, from the web interface it loads perfectly.
 
I have also activated the option "enable api interface" in ... certificates & security -> remote access
 
Thanks for the help you can give me!

3 comments

Avatar
1
Nick Smylie

Hi Lexprevi,

Let me look into this and get back to you.

EDIT:

I tried using the same command as you...

curl -X POST --data-binary @4kcombo.cer -k "https://bal:pwd@x.x.x.x/access/addcert?cert=NTEST&replace=1"

I tried with and without wrapping my file location in quotations as well, both times it worked.

Next I checked the data file location...

That file within my root directory worked fine.  However when I tried putting in a invalid path I got the same error as you.

I put that file inside a folder inside my root directory and specified the correct path and the command came back successful.

curl -X POST --data-binary "@~/4k/4kcombo.cer" -k "https://bal:pwd@x.x.x.x/access/addcert?cert
=NTEST&replace=0"    -- INVALID
 
curl -X POST --data-binary "@./4k/4kcombo.cer" -k "https://bal:pwd@x.x.x.x/access/addcert?cert
=NTEST&replace=0"   -- VALID
 
Can you try editing your path and see what happens?
Avatar
0
lexprevi

Hi Nick,

yes the problem is path :P ... I did not insert the "@" character in the file address

curl -X POST --data-binary "@c:\temp\file.combo.pem" -k "https://bal:pwd@x.x.x.x/access/addcert?cert=certificatename&replace=1"

Thank you!
Avatar
0
Nick Smylie

Ahh yes, I missed that also until just now!  Glad it was a simple fix.  :)