首页 > 解决方案 > 调用 ImportCertificate 操作时发生错误(ValidationException):不支持私钥

问题描述

我正在使用 AWS CLI 将证书导入到 region us-east-1,如下所示:

aws acm import-certificate --certificate cert.crt --private-key private.key --certificate-chain chain.crt --profile prof --region us-east-1

这在过去对其他证书有效,但是我最近开始看到以下错误:

An error occurred (ValidationException) when calling the ImportCertificate operation: The private key is not supported.

我已经通过openssl检查了私钥确实与证书匹配,所以我对这里可能出现的问题非常迷茫。

openssl rsa -in private.key -check

产量

RSA key ok

可能是什么问题?

标签: amazon-web-servicesaws-cli

解决方案


我也遇到了这个问题,并在其他地方发现了一个提示,建议在你的文件前加上“file://”。为我工作。试试看:

aws acm import-certificate --certificate file://cert.crt --private-key file://private.key --certificate-chain file://chain.crt --profile prof --region us-east-1

推荐阅读