set webhook for telegram bot and what is self sign certificate

巧了我就是萌 提交于 2019-12-24 07:48:28

问题


I set webHook for my telegram bot by this :

> https://api.telegram.org/bot<Token>/setWebhook?url=https://mywebapp.com/index.jsp

I don't set any certificate for this. But when I (or a telegram user) send message to this bot, https://mywebapp.com/index.jsp does not get any request!! when I send any kind of message to robot, no request gotten by https://mywebapp.com/index.jsp. What should I do? Is certificate necessary for telegram bot webhook?


回答1:


  • You need a valid SSL certificate for webhooks to work.
  • To use a self-signed certificate, you need to upload your public key certificate - using the certificate parameter in setWebhook. Please upload as InputFile, - sending a String will not work.
  • Ports currently supported for Webhooks: 443, 80, 88, 8443.
  • Wildcard certificates may not be supported.
  • Redirects are not supported.
  • CN must exactly match your domain.



回答2:


open https://requestb.in/ and "Create a RequestBin" as listener for callback URL

It is no need any certificate file because it has valid ssl.

Be sure it works, other wise some think is wrong.



来源:https://stackoverflow.com/questions/38407721/set-webhook-for-telegram-bot-and-what-is-self-sign-certificate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!