skip to Main Content

I want to setup Telegram Webhook but I don’t have https URL, I don’t want to deal with ssl certificates either.

Can I solve this problem by using https URL or without setting https certificate up?

Telegram webhook desc: https://core.telegram.org/bots/api#setwebhook

4

Answers


  1. You can’t without a proper certificate, but it’s now really easy to get one (and for free) : https://letsencrypt.org/getting-started/

    Login or Signup to reply.
  2. You have two options to get updates from telegram:

    1. Webhook, this method works over ssl only (yes, I agree with Tom – let’s encrypt is awesome)
    2. getUpdates method, that work using long polling, this method does not require ssl. More info in API documentation: https://core.telegram.org/bots/api#getupdates
    Login or Signup to reply.
  3. You can take advantage of the Cloudflare Universal SSL to protect your endpoint with SSL. You don’t have to deal with anything.

    Login or Signup to reply.
  4. https is mandatory but it doesn’t mean you MUST set it up completely. You can use more more simple ways, let me explain:

    You can connect your localhost server on your own PC or mac or linux machine, to telegram severs without setting any SSL Certificates.
    With using “ngrok.com Secure tunnels” you will have a https address that is mandatory for dealing with webhooks but no need to setup any SSL. enter image description here

    All steps you need (in PC):

    1- Download ngrok.exe

    2- Run in command line : “ngrok http 8888”

    3- It is ready Now!

    very simple,is not it

    After running ngrok.exe it shows you somthing like: “https://abcd1234.ngrok.io
    This is your temporary https that you can use as webhook. It is valid and belong to your bot until you close ngrok.exe( I even standby my computer without closing app and it remains for me-excellent)
    enter image description here

    Additionally with this app i have access to all messages that Telegram send to my bot and my bot api outputs (not include my sent message) as JSON show. You can access to these panel via http://localhost.com:4040 . This is a sample:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search