【问题标题】:Converting a PFX for AWS Certificate Manager not working为 AWS Certificate Manager 转换 PFX 不起作用
【发布时间】:2019-03-19 00:53:39
【问题描述】:

我在转换用于导入 AWS 的 Trustwave 证书时遇到了一些问题。我收到了受密码保护的 PFX 并运行了这些命令并在每一步都输入了正确的密码提示:

openssl pkcs12 -in cert.pfx -nocerts -out key.pem
openssl rsa -in key.pem -out server.key
openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.pem
openssl pkcs12 -in cert.pfx -nodes -nokeys -out chain.pem

一旦我这样做了,我会得到四个文件并将它们插入 AWS Certificate Manager,如下所示:

server.key (Certificate Private Key)
cert.pem (Certificate Body)
chain.pem (Certificate Chain)
key.pem (Not used, but generated by the second command)

当我导入 AWS 时抱怨:Could not validate the certificate with the certificate chain. Choose Previous button below and fix it.

所以我尝试在https://ssl.trustwave.com/support/support-root-download.php 下载 Trustwave 根证书(域验证 > 下载根证书)。

我尝试将链更改为 chain.pem 和 stca.crt(提供的根证书)的组合。似乎无法获得正确的组合,并试图了解它是如何正常工作的。

我注意到的一件事是 chain.pem 和 cert.pem 在导出文件的顶部附加了这个:

Bag Attributes
    localKeyID: 01 00 00 00 
    friendlyName: ***************
subject=/CN=*************.com/O=*****************/L=Richmond/ST=British Columbia/C=CA
issuer=/C=US/ST=Illinois/L=Chicago/O=Trustwave Holdings, Inc./CN=Trustwave Organization Validation SHA256 CA, Level 1/emailAddress=ca@trustwave.com

这些细节重要吗?如果重要,它们是什么意思,我该如何解决?

【问题讨论】:

  • 我已将我的 .pfx 证书从 Azure 迁移到 .pem 文件,但出现了同样的错误。一些线程 (link) 正在讨论 Openssl pkcs12 命令在链中的错误顺序。

标签: ssl-certificate aws-certificate-manager


【解决方案1】:
openssl pkcs12 -in _cert.pfx -nocerts -out certOut.key.pem
openssl rsa -in certOut.key.pem -out certOut.server.key
openssl pkcs12 -in _cert.pfx -clcerts -nokeys -out certOut.cert.pem
openssl pkcs12 -in _cert.pfx -nodes -nokeys -out certOut.chain.pem

证书正文:certOut.cert.pem

证书私钥:certOut.server.key

证书链:certOut.chain.pem

复制/粘贴包括“-----BEGIN RSA PRIVATE KEY-----”和“-----BEGIN CERTIFICATE-----”标头。 没有任何顶级属性

【讨论】:

    猜你喜欢
    • 2017-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-14
    • 2016-05-12
    • 1970-01-01
    • 2017-06-20
    • 2018-02-28
    相关资源
    最近更新 更多