Symptoms
-
When uploading an SSL certificate to Plesk, the operation fails with the error message:
PLESK_ERROR: Unable to set the private key: Probably, the private key format is invalid
-
Private Key in the .key file contains the following string:
-----BEGIN ENCRYPTED PRIVATE KEY----
Cause
The Certificate Private Key part is encrypted.
Resolution
-
Connect to the Plesk server via SSH.
-
Upload the .key file to the server.
-
Decrypt the .key file using the
openssl
utility:# openssl rsa -in my_encrypted.key -out my_decrypted.key
where:
- my_encrypted.key – is an uploaded file from step 2
- my_decrypted.key – a decrypted file that will be created
Note: To decrypt the key, a passphrase that was entered upon creating the key is required. It will be requested by
openssl
. -
Use the new decrypted .key file (In this example, my_decrypted.key) to upload an SSL certificate in Plesk.