1

我刚刚获得了 Thawte 123 SSL 证书,但在将其上传到 AWS 以将其与 CloudFront 一起用作自定义 SNI SSL 证书时遇到问题。AWS 拒绝 CA 链。我正在为SSL Web 服务器和 Thawte 通配符证书使用Thawte 中间 CA 捆绑包

为了能够使用我的私钥,我将其转换为 RSA 密钥:

openssl rsa -in private.key -out private-rsa-key.pem`

并尝试使用以下方式上传:

aws iam upload-server-certificate --server-certificate-name example.com-certificate --certificate-body file://certificate.pem --private-key file://private.pem --certificate-chain https://search.thawte.com/library/VERISIGN/ALL_OTHER/thawte%20ca/SSL_CA_Bundle.pem --path /cloudfront/example.com/

导致以下错误:

A client error (MalformedCertificate) occurred when calling the UploadServerCertificate operation: Unable to validate certificate chain. The certificate chain must start with the immediate signing certificate, followed by any intermediaries in order. The index within the chain of the invalid certificate is: 0

即使将thawte_Primary_Root_CA.pem作为第一个即时签名证书插入证书链,也不能解决问题。

A client error (MalformedCertificate) occurred when calling the UploadServerCertificate operation: Unable to validate certificate chain. The certificate chain must start with the immediate signing certificate, followed by any intermediaries in order. The index within the chain of the invalid certificate is: 1

Thawte CA 链与 AWS 不兼容吗?

4

4 回答 4

1

我现在遇到同样的问题,并尝试了一切。使用 SSL123 证书(我的 rsa 密钥和 pem 都可以)

我无法以任何顺序使用 Thawte 提供的主要和次要证书。我单独尝试了主要,单独的次要,主要+次要,次要+主要,还尝试了根证书,还尝试了主要和次要:

https://search.thawte.com/library/VERISIGN/ALL_OTHER/thawte%20ca/SSL123_SecondaryCA.pem

https://search.thawte.com/library/VERISIGN/ALL_OTHER/thawte%20ca/SSL123_PrimaryCA.pem

我能从 ELB 得到的唯一东西是:

无法验证证书链。证书链必须从直接签名证书开始,然后是任何中间人。无效证书链内索引为:0

索引并不总是-1,也可能是 0,1 和 2,具体取决于订单和包含的证书数量。

[为我解决]

显然,您从中创建证书的 EC2 实例会影响。我使用带有默认 AMI 的标准 EBS 实例,并再次转换了 Thwate 提供的证书,它确实有效。

这里的步骤:

企业社会责任:

keytool -genkey -keysize 2048 -keyalg RSA -alias mycertificate -keystore keystore.jks

Thatwe 回复后:(主要是电子邮件链中的第二个证书)。

导入keystore.jks中的三个证书

keytool -import -alias Primary -trustcacerts -file Primary.crt -keystore keystore.jks
keytool -import -alias Secondary -trustcacerts -file Secondary.crt -keystore keystore.jks
keytool -import -alias mycertificate -trustcacerts -file mycertificate.cer -keystore keystore.jks

JSK > P12 - 将 keystore.jks 转换为 p12 格式

keytool -importkeystore -srckeystore keystore.jsk -destkeystore keystore.p12 -srcstoretype jks -deststoretype pkcs12

P12 > PEM - 将 p12 格式转换为 pem 格式

openssl pkcs12 -in keystore.p12 -out keystore.pem -nodes

PEM > RSA PRIVATE KEY - 以 RSA 格式导出私钥

openssl rsa -in keystore.pem -text > keystore_rsa.pem

这次确实奏效了。

于 2015-04-28T15:57:39.187 回答
1
  1. 您必须确保证书、私钥和证书链都是 PEM 编码的,如下所示:
-----BEGIN CERTIFICATE----- << -This is my Intermediate CA which signed my CSR 
Base64-encoded certificate
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE----- << -This is my Root CA which signed my Intermediate CA
Base64-encoded certificate
-----END CERTIFICATE-----
  1. 您无需将签名证书放入链中。
    只需在 Chain 文件中添加中间和根 ca 就足够了。
于 2019-05-15T12:04:19.140 回答
0

使用以下作为 ca 链证书可以解决问题:

https://ssltools.thawte.com/chainTester/webservice/validatecerts/certificate?certKey=issuer.intermediate.cert.57&fileName=thawte%20DV%20SSL%20CA%20-%20G2&fileExtension=txt

于 2015-02-02T10:59:31.497 回答
0

请务必注意,中间证书并非特定于您的域或证书。因此,每个颁发的与您类似的证书都具有完全相同的中间证书。

你可以把它们想象成支票上的路由号码。路由号码是必需的,但实际上更多的是关于您的银行而不是关于您的信息。在这种情况下,您的帐号或证书对您来说是独一无二的。

由于中间证书的通用性,有这样的网站:

https://www.ssl2buy.com/wiki/ssl-intermediate-and-root-ca-bundle

为不同的证书颁发者预先捆绑了所有中间证书(并以正确的顺序)。

于 2017-05-22T20:08:20.303 回答