• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Issue SSL cert via REST API

BenC

New Pleskian
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.

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
and
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
 
The files are meant to be on the same server you are running the command/api call on. The full path should be used for both the key and the csr file. Like for example D:\certs\server.csr.

For this particular API call, the call gets forwarded the CLI. To trouble shoot your issue you could try and see if are able to create/issue a certificate via CLI directly. See Plesk CLI documentation for Windows here.
 
Back
Top