首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Amazon无法验证thawte证书链

Amazon无法验证thawte证书链
EN

Stack Overflow用户
提问于 2015-02-02 10:15:25
回答 4查看 4.3K关注 0票数 1

我刚刚得到了一个Thawte123SSL证书,并在将它上传到AWS以与CloudFront一起使用它作为自定义SNI证书时遇到了问题。AWS拒绝CA链。我正在使用Thawte中间CA束作为SSL Web Server和Thawte通配符证书

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

代码语言:javascript
复制
openssl rsa -in private.key -out private-rsa-key.pem`

并试图将其上传到:

代码语言:javascript
复制
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

即使将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

compatible链与AWS不兼容吗?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-04-28 15:57:39

我现在也有同样的问题,什么都试过了。使用SSL123证书(我的rsa密钥和pem都可以)

我无法按任何顺序工作由Thawte提供的初级和二级证书。我单独尝试了主服务器,独立地尝试了primary+secondary,secondary+primary,也尝试了根证书,也尝试了来自以下方面的主要和次要的内容:

SecondaryCA.pem

PrimaryCA.pem

我唯一能从ELB得到的是:

无法验证证书链。证书链必须从立即签名证书开始,然后是任何中介体。无效证书链中的索引为:0

其中索引并不总是-1,但也是0、1和2,这取决于所包含的顺序和证书数量。

为我解决了

显然,创建证书的EC2实例会影响到。对于默认的AMI,我使用了一个标准的EBS实例,并再次转换了Thwate提供的证书,它确实起了作用。

这里的步骤:

企业社会责任:

代码语言:javascript
复制
keytool -genkey -keysize 2048 -keyalg RSA -alias mycertificate -keystore keystore.jks

一旦我们回复:(主要是电子邮件链中的第二个证书)。

在keystore.jks中导入三个证书

代码语言:javascript
复制
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格式

关键工具-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私钥-导出RSA格式的私钥

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

这次确实奏效了。

票数 1
EN

Stack Overflow用户

发布于 2019-05-15 12:04:19

  1. 必须确保证书、私钥和证书链都是PEM编码的,如下所示:
代码语言:javascript
复制
-----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. 你不需要把你的签名证书放在链子里。 只需在链文件中添加中间和根ca就足够了。
票数 1
EN

Stack Overflow用户

发布于 2015-02-02 10:59:31

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28275332

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档