【发布时间】:2018-07-25 04:03:49
【问题描述】:
我使用 pyTelegrambotAPI、cherrypy 作为网络服务器、更新方法 webhook、自签名证书,今晚在工作六个月后没有任何问题,我的 2 个机器人停止响应。
当我使用命令时:
https://api.telegram.org/botMYTOKEN/getwebhookinfo 结果是
{"ok":true,"result":{"url":"https://MY.IP.ADRESS/MYTOKEN/","has_custom_certificate":false,"pending_update_count":16853,"last_error_date":1518617645,"last_error_message":"SSL 错误{337047686,错误:1416F086:SSL 例程:tls_process_server_certificate:certificate verify failed}","max_connections":40}}
所以说SSL的错误,然后我尝试制作一个新的自签名证书并使用命令
curl -F "url=https://MY.IP.ADRESS" -F "certificate=@C:\Users\007\Desktop\bin\webhook_cert5.pem" https://api.telegram.org/botMYTOKEN/setWebhook
答案是
{"ok":true,"result":true,"description":"Webhook 已设置"}
但 10 秒后,其证书验证失败。电报块是自签名证书吗?还是我做错了什么?
【问题讨论】:
-
我想当我在自签名证书 Telegram 的完整路径之前使用 @ 符号从 curl 设置 webhook 时,看到它并且一切正常,但是当我运行我的网络服务器 Telegram 思考我的证书来自某个 CA,无法验证它
标签: ssl telegram python-telegram-bot