AWS CloudFront SSL证书-MalformedCertificate错误 [英] AWS CloudFront SSL Certificate - MalformedCertificate error

查看:277
本文介绍了AWS CloudFront SSL证书-MalformedCertificate错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将SSL证书上传到cloundfront的AWS IAM时遇到问题。
我认为该命令可以使用,文件也可以,但是仍然会出现错误。

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.

我们正在使用以下命令来上传SSL证书:

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/

错误:


调用UploadServerCertificate操作时发生客户端错误(MalformedCertificate):无法解析证书
ficate。请确保证书为PEM格式。

A client error (MalformedCertificate) occurred when calling the UploadServerCertificate operation: Unable to parse certi ficate. Please ensure the certificate is in PEM format.

我该如何解决?

推荐答案

您可以做两件事。首先,显然要检查您的证书是否为.PEM格式。

You can do two things.. first obviously check your cert is in .PEM format.

PEM证书应该是ASCII可读的。它需要以
----- BEGIN CERTIFICATE -----开头,然后有base64编码的数据,并且必须以----- END CERTIFICATE -----结尾。

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-----.

然后确保在命令行参数中的文件名之前添加 file:// 。这是一个示例:

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

这篇关于AWS CloudFront SSL证书-MalformedCertificate错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆