问题
I am facing problem when uploading SSL certificate to AWS IAM for cloundfront. I think that the command is ok and files are OK but still it gives an error.
We are using the following command for uploading SSL certificate:
aws iam upload-server-certificate --server-certificate-name SSL-CloudFront --certificate-body Public.cer --private-key keyStore.pem --certificate-chain STAR_xxxxxx_com.ca-bundle --path /cloudfront/ICE_SSL/
Error:
A client error (MalformedCertificate) occurred when calling the UploadServerCertificate operation: Unable to parse certi ficate. Please ensure the certificate is in PEM format.
How can I fix that?
回答1:
You can do two things.. first obviously check your cert is in .PEM format.
A PEM certificate should be ASCII-readable. It needs to start with -----BEGIN CERTIFICATE-----, then there is base64-encoded data, and it must end with a line -----END CERTIFICATE-----.
Then make sure you add a file:// before the file names in the command line parameters. Here is an example:
aws iam upload-server-certificate --server-certificate-name TestCert --certificate-body file://server.crt --private-key file://privatekey.pem
来源:https://stackoverflow.com/questions/29677051/aws-cloudfront-ssl-certificate-malformedcertificate-error