Submitted by george.asenov on Thu, 04/28/2016 - 01:39
Hello,
We are trying to use the API to give users the opportunity to install SSL certificates on their own but we face an issue.
We have tried to send the API query many ways and the result is the same: "Invalid data for cert : Data does not start with line -----BEGIN CERTIFICATE-----"The certificate does START with "-----BEGIN CERTIFICATE-----"
We have tested to send the request to the remote API trough POST parameters, GET parameters and also local command line (plain text certificate, not using file) and none of them work. IS this a bug or we do not do something right. How to pass the certificates to the remote API so they are successfully recognized and installed?
Status:
Active
Comments
Submitted by JamieCameron on Thu, 04/28/2016 - 23:27 Comment #1
The API only supports passing in the cert via a filename unfortunately - so won't really work for remote calls.
Submitted by george.asenov on Fri, 05/13/2016 - 02:43 Comment #2
Is there a workaround? Or can this be fixed somehow. Like sending file trough post request and then virtualmin to parse it?
Submitted by JamieCameron on Fri, 05/13/2016 - 19:29 Comment #3
The only work-around right now is to first upload the cert to a file on the server, and then call the API command with the path to that file.
Submitted by miltosc on Sat, 05/28/2016 - 10:44 Comment #4
I uploaded file. crt by comodo i get the same error.
i tried unix2dos and fold -w64
i converted to .pem
i tried to pass it plaintext from command line
and i still get the error
virtualmin install-cert --domain mydomain.com --cert mydomain.crt
Invalid data for cert : Data does not start with line -----BEGIN CERTIFICATE-----
I use
virtualmin 4.17
debian wheezy
Thanks in advance for any help
Submitted by JamieCameron on Sat, 05/28/2016 - 16:48 Comment #5
Make sure you supply the file path to the cert file, like
/tmp/mydomain.crt