Reputation: 845
I have problem when creating Telegram Bot with a webhook.
Currently I have done this:
I try to follow test script from https://core.telegram.org/bots/webhooks#testing-your-bot-with-updates, example is:
curl --tlsv1 -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"update_id":10000,"message":{ "date":1441645532,"chat":{"last_name":"Test Lastname","id":1111111,"first_name":"Test","username":"Test"},"message_id":1365,"from":{"last_name":"Test Lastname","id":1111111,"first_name":"Test","username":"Test"},"text":"/start"}}' "https://xxx.xxx.xxx.xxx"
It works fine.
I am sure that parameter 'url' and 'certificate' in API of 'setWebhook' works fine, because when I call API of 'getWebhookInfo' to Telegram, it replied:
{ "ok": true, "result": { "url": "https://xxx.xxx.xxx.xxx", "has_custom_certificate": true, "pending_update_count": 25, "last_error_date": 1484557151, "last_error_message": "Connection timed out", "max_connections": 40 } }
I try to send any message to my bot, but nothing shown in my internal application log, and when I call API of 'getWebhookInfo' it always show the same, it said "Connection timed out"
What should I do in my certificate?
Upvotes: 2
Views: 4196
Reputation: 71
I had the same problem at last week, webhooks worked and stopped (timeout error). It turned out because of the blocking of the telegram in Russia. My server was not in Russia, it was in Holland, but after the server was changed it all worked.
Upvotes: 0