简体   繁体   English

Heroku SSL问题给我验证失败

[英]Heroku SSL issue its give me verification fails

I updated my all certificate on heroku with this command 我用此命令更新了我在heroku上的所有证书

heroku certs:add heroku.pem server.key -a myapp --bypass

heroku.pem has below details heroku.pem具有以下详细信息

-----BEGIN CERTIFICATE----- 
entrustcert.crt
-----END CERTIFICATE----- 
-----BEGIN CERTIFICATE----- 
L1Cchain.txt
-----END CERTIFICATE----- 
-----BEGIN CERTIFICATE----- 
L1Croot.txt
-----END CERTIFICATE-----

when I run test on server its give me this result 当我在服务器上运行测试时,给我这个结果

SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.

I have entrust SSL certificate. 我已委托SSL证书。

Please help me to solve this issue 请帮我解决这个问题

command that I use for test : 我用于测试的命令:

curl -kvI "my HTTPS domain name" 

Try this guide. 试试这个指南。

Also the official documentation states 官方文件也指出

Next add your certificate, any intermediate certificates, and private key to the endpoint with the certs:add command 接下来,使用certs:add命令将证书,所有中间证书和私钥添加到端点。

It is somewhat in contradiction with the guide above because it doesn't say anything about root CA certificate. 它与上面的指南有些矛盾,因为它没有提及根CA证书。 But I would definitely try the guide and if it does not work I would remove root certificate from heroku.pem. 但是我一定会尝试该指南,如果它不起作用,我将从heroku.pem中删除根证书。

Please help me to solve this issue 请帮我解决这个问题

Curl should no be claiming error 19. Error 19 is OpenSSL's X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN . Curl不应声明错误19。错误19是OpenSSL的X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN You have at least two problems. 您至少有两个问题。


First, you're sending a certificate chain that includes your root. 首先,您要发送包含根的证书链。 Don't send the root in the certificate chain. 不要在证书链中发送根。 Only send the end entity (server) certificate and any intermediates required to build a chain to the trusted root. 仅将最终实体(服务器)证书和构建链所需的所有中间层发送到受信任的根。 If there are no intermediates, then only send the end entity (server) certificate. 如果没有中间件,则仅发送最终实体(服务器)证书。

If I am reading your post correctly, that means: 如果我正确阅读了您的信息,则意味着:

-----BEGIN CERTIFICATE----- 
server cert (entrustcert.crt)
-----END CERTIFICATE----- 
-----BEGIN CERTIFICATE----- 
intermediate cert (L1Cchain.txt)
-----END CERTIFICATE----- 

Second, you need Curl to trust your root. 其次,您需要Curl信任您的根。 I don't really use Curl, so I don't know how to pass in a single root to trust. 我并没有真正使用Curl,所以我不知道如何传递单个根来信任。 Looking through the curl(1) man pages , it does not appear Curl allows you to specify a trust point. 浏览curl(1)手册页 ,似乎没有出现。Curl允许您指定信任点。 So curl is probably the wrong tool for the job. 因此,卷曲可能是这项工作的错误工具。

Here's how you do it with OpenSSL's s_client (the CAfile option): 这是使用OpenSSL的s_clientCAfile选项)的方法:

printf "GET / HTTP/1.0\r\n" | openssl s_client \
    -connect example.com:443 \
    -CAfile <root to trust>

The -CAfile will use one of the Entrust roots at Entrust Root Certificates - SSL . -CAfile将使用Entrust根证书SSL上的Entrust根之一 But I don't know which one since you're not sharing a URL or domain. 但是我不知道是哪一个,因为您不共享URL或域。

You can drop the printf if you want, and just use openssl s_client . 如果需要,可以删除printf ,而只需使用openssl s_client But s_client won't finish until the socket is closed (or CTRL C is pressed). 但是s_client在关闭套接字(或按CTRL C )之前不会完成。

With an OpenSSL s_client trace, you will be able to determine the intermediates required to build the chain, too. 使用OpenSSL s_client跟踪,您也可以确定构建链所需的中间件。 For an example of interpreting s_client results, see s_client verify certificate failed, but browser accept and Can't verify CA certificate unless CApath or CAfile used . 有关解释s_client结果的示例,请参阅s_client验证证书失败,但是浏览器接受并且无法验证CA证书,除非使用了CApath或CAfile


Third, the -k option is a client side key option. 第三, -k选项是客户端密钥选项。 I don't believe you need it since you are not sending a client certificate. 我不认为您不需要它,因为您没有发送客户证书。 But I don't believe this is part of your problem, either. 但这也不是您问题的一部分。


I have entrust SSL certificate. 我已委托SSL证书。

Finally, you can get free Class 1 certificates from Startcom . 最后,您可以从Startcom获得免费的1类证书。 They are trusted by default in most desktop and mobile browsers. 默认情况下,大多数台式机和移动浏览器都信任它们。

While Startcom issues the certificates for free, they do charge for revocation because that's what costs money. 虽然Startcom是免费颁发证书的,但它们确实要收取吊销费用,因为那是要花钱的。 Others charge for the revocation up front and pocket the money if not needed. 其他人则收取撤销费用,如果不需要的话,可以将其收入囊中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM