WindowsSysadmin
New Pleskian
Hi Team,
I'm having a spot of trouble using the command line option to import a certificate into plesk:
PS C:\Program Files (x86)\Plesk\bin> .\certificate.exe --create "star.mycertificate.co.nz_2018" -admin -default -key-file $keyfile -cert-file $certfile -cacert-file $intermediaryfile
Unable to create certificate "star.mycertificate.co.nz_2018": Unable to set the private key: Probably, the private key format is invalid.
PS C:\Program Files (x86)\Plesk\bin> $keyfile
c:\pleskinstaller\star.mycertificate.co.nz.key
My Private Key looks like this:
-----BEGIN RSA PRIVATE KEY-----
myprivatekeydata
-----END RSA PRIVATE KEY-----
Now, I've deleted and re-created the file using various notepad editors and copied the Private key carefully. So to test - I opened up the Plesk Panel, opened my star.mycertificate.co.nz.key file - Ctrl-A, Ctrl-C, and pasted that directly into the Plesk Panel (along with the Cert and CA cert) - hit upload and hey presto! the Certificate is imported successfully. Seeing as the same data is parsed successfully by the Panel and imported without error, this leads me to believe there is a bug in the certificate.exe CLI option.
OS is Windows Server 2016 - the commands above are being invoked from within a Powershell Session, however I have been using a Powershell Session to leverage the other Plesk CLI utilities for Windows without issue.
Can you please advise?
I'm having a spot of trouble using the command line option to import a certificate into plesk:
PS C:\Program Files (x86)\Plesk\bin> .\certificate.exe --create "star.mycertificate.co.nz_2018" -admin -default -key-file $keyfile -cert-file $certfile -cacert-file $intermediaryfile
Unable to create certificate "star.mycertificate.co.nz_2018": Unable to set the private key: Probably, the private key format is invalid.
PS C:\Program Files (x86)\Plesk\bin> $keyfile
c:\pleskinstaller\star.mycertificate.co.nz.key
My Private Key looks like this:
-----BEGIN RSA PRIVATE KEY-----
myprivatekeydata
-----END RSA PRIVATE KEY-----
Now, I've deleted and re-created the file using various notepad editors and copied the Private key carefully. So to test - I opened up the Plesk Panel, opened my star.mycertificate.co.nz.key file - Ctrl-A, Ctrl-C, and pasted that directly into the Plesk Panel (along with the Cert and CA cert) - hit upload and hey presto! the Certificate is imported successfully. Seeing as the same data is parsed successfully by the Panel and imported without error, this leads me to believe there is a bug in the certificate.exe CLI option.
OS is Windows Server 2016 - the commands above are being invoked from within a Powershell Session, however I have been using a Powershell Session to leverage the other Plesk CLI utilities for Windows without issue.
Can you please advise?