Search code examples
telegramtelegram-bot

Telegram webhook: Is ssl mandatory?


I want to know if SSL certificate and URL starting with https:// is mandatory for webhook of a Telegram bot? As it noticed in https://core.telegram.org/bots/api#setwebhook it seems it is necessary, but I'm not sure about this.


Solution

  • As Telegram Bot documentation says:

    All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form.

    • 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.

    Setting up SSL is not hard and there or completely free ways too(like free valid SSL certs or self-sign methods)