AWS CloudFront SSL Certificate - MalformedCertificate error

亡梦爱人 提交于 2019-12-22 00:01:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!