问题
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