电报漫游器SSL错误:SSL错误{error:1416F086:SSL例程:tls_process_server_certificate:证书验证失败}

Moh*_*ehi 3 php ssl bots telegram

我使用免费的SSL加密(默认情况下,我的主机提供商支持它),我在sslshopper.com(唯一的警告是:)The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate. Learn more about this error. The fastest way to fix this problem is to contact your SSL provider. https://www.geocerts.com/ssl_checker中检查了我的网站, 结果是我的网站通过了除以外的所有测试Certificate Chain Complete。所以我不认为问题出在证书上,电报据我所知接受自签名证书。

我尝试在https://core.telegram.org/bots/samples/hellobot上使用电报示例bot,设置Webhook URL后,在https://api.telegram.org/bot[my -token] / getWebhookinfo

结果是:

{ "ok": true, "result": { "url": "https://itest.gigfa.com/tlg1/tlg1.php", "has_custom_certificate": false, "pending_update_count": 17, "last_error_date": 1521140994, "last_error_message": "SSL error {337047686, error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}", "max_connections": 40 } }

该机器人完全无法运行。

cod*_*ade 5

是的,问题出在您的证书上。

您的getWebHookInfo中的错误:

"last_error_message":"SSL error {337047686, error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}"
Run Code Online (Sandbox Code Playgroud)

Telegram说它需要整个证书链(也称为CA Bundle或全链证书)。

如何检查您的证书:

您可以使用SSL Labs SSL服务器测试服务来检查您的证书:

只需像下面的示例那样传递您的网址,即可替换coderade.github.io为您的主机:

https://www.ssllabs.com/ssltest/analyze.html?d=coderade.github.io&hideResults=on&latest

如果看到“链接问题:不完整”,则说明您没有提供完整的链式证书。

怎么修:

为您的SSL证书提供商下载完整的链式证书,并将其安装在您的网络服务器上。

我不知道你正在使用的服务,但对于我的例子gunicorn我解决了添加CA-证书ca-bundle我的SSL证书提供商已发送文件(在我的情况下Namecheap科摩多对我的SSL配置),如下面的例子:

ca_certs = "cert/my-service.ca-bundle"
Run Code Online (Sandbox Code Playgroud)

有关更多信息:@martini对此线程的回答以及FIX:Telegram Webhooks Not Working帖子。