SonicOS api import cert-key-pair
I'm trying to import a cert-key-pair using the sonicOS api. Per the swagger documentation I should be able to pass the FTP url as is, but if I do that I get an error 404. I attempted to URL encode it but then I got an error 405. Using the escape sequence made no difference, I still got the same error codes.
Is this a bug or I'm missing something?
Edit: It seems there is a bug in swagger that if you don't provide an IP and port in the URL it does not show all options available for cert-key-pair import.
Best Answer
-
WUT Newbie ✭
So I figured it out. I was using POST instead of PUT.
Note: There is no need to use the escape characters, you have to URLENCODE the ftpurl.
Working code command:
curl -X PUT "https://sonicwall.IP/api/sonicos/certificates/import/cert-key-pair/name/mycertificate/password/passwd/ftp/ftp%3a%2f%2fusername%3apassword%40hostname.com%2ftest.pfx" -k
2