28

I'm doing:

aws iam upload-server-certificate --server-certificate-name MysiteCertificate --certificate-body Downloads/mysite/mysite.crt --private-key mysite.pem --certificate-chain Downloads/mysite/COMODOSSLCA.crt

I'm getting an error though: A client error (MalformedCertificate) occurred when calling the UploadServerCertificate operation: Unable to parse certificate. Please ensure the certificate is in PEM format.

It is a valid pem file though =(

Shamoon
  • 901
  • 4
  • 14
  • 22

2 Answers2

54

Add a file:// before the file names.

peterh
  • 4,914
  • 13
  • 29
  • 44
LinuxDevOps
  • 1,754
  • 9
  • 14
8

I've seen this when the key wasn't in RSA format. If you check the header for your key and it is -----BEGIN PRIVATE KEY----- instead of -----BEGIN RSA PRIVATE KEY----- that's probably your problem. You can get the key into RSA with:

 openssl rsa -in my-private-key.pem > private-rsa-key.pem
Jeremy Logan
  • 255
  • 3
  • 12
  • this is the only place i could find this answer. thanks! – Nuriel Jun 14 '15 at 08:56
  • I have it beginning with `-----BEGIN RSA PRIVATE KEY-----`, and its been outputted as a `.pem` and for sure `RSA`, but it still returns the same error. I generated the key with `openssl genrsa -des3 -out server.pass.key 2048` and `openssl rsa -in server.pass.key -out server.key` – Trip Dec 21 '15 at 20:21