- Server operating system version
- Windows
- Plesk version and microupdate number
- Version 18.0.55 Update #2
Hi,
I have been trying the REST API for creating/renewing certificates. I saw the useful article here https://support.plesk.com/hc/en-us/articles/12377059948183 I cant get the code to work, however i am making some assumptions that the files are meant to be on the computer making the curl request.
When I try the above (with the correct API key) I get the error
The files are in the directory I am running the curl command from (linux machine). I have tried specifying the file as
,
and
Are the files meant to be on the computer you are making the curl request from ? or are they meant to be on the server ?
If they are meant to be on the (windows) server , do you state the full file path e.g D:\certs\server.csr ? (I did try this as well , but got the same error.)
I have a feeling i am missing something obvious here.
Any help appreciated.
Kind Regards,
Ben
I have been trying the REST API for creating/renewing certificates. I saw the useful article here https://support.plesk.com/hc/en-us/articles/12377059948183 I cant get the code to work, however i am making some assumptions that the files are meant to be on the computer making the curl request.
Bash:
curl -k -X POST -H "X-API-Key: ce8b9a38-4410-. . ." -H "Content-Type: application/json" -H "Accept: application/json" "https://<Server_IP>:8443/api/v2/cli/certificate/call" -d '{ "params": ["--create", "mynewcert", "-domain", "example.com", "-csr-file", "server.csr", "-key-file", "server.key"]}'
When I try the above (with the correct API key) I get the error
Bash:
"code": 1,
"stdout": "",
"stderr": "Unable to create certificate \"mynewcert\": file server.csr dose not exist"
The files are in the directory I am running the curl command from (linux machine). I have tried specifying the file as
Code:
server.csr
Code:
./server.csr
Code:
@server.csr
Are the files meant to be on the computer you are making the curl request from ? or are they meant to be on the server ?
If they are meant to be on the (windows) server , do you state the full file path e.g D:\certs\server.csr ? (I did try this as well , but got the same error.)
I have a feeling i am missing something obvious here.
Any help appreciated.
Kind Regards,
Ben