telegram-bot icon indicating copy to clipboard operation
telegram-bot copied to clipboard

HTTPS Server listening for updates via setWebhook

Open LukasKalbertodt opened this issue 10 years ago • 8 comments

I just added the method set_webhook on the dev branch. However, I wasn't able to provide a listen method that works similar to long_pull, but uses the webhook to acquire updates.

There are several problems that stop me from implementing listen, but mainly I didn't do it for this reason: I can't test it. Telegram sends updates via HTTPS only and does NOT accept self signed certs. Maybe this will change in the future, but right now I don't have time to get one and test more http stuff.

Just use long_pull for now.

LukasKalbertodt avatar Jul 07 '15 19:07 LukasKalbertodt

You can use the openshift free plan to use the webhook, I'm using it and the SSL is handled automatically. https://hub.openshift.com/quickstarts/150-rust

When I have time I'll test this library to learn Rust for sure :smile:

rockneurotiko avatar Jul 07 '15 19:07 rockneurotiko

I'm not sure if you misunderstood me or the other way around ;)

I am talking about the Telegram-API method setWebhook. A bot can listen as a https server and receive updates on that way. This has nothing to do with git or anything...

LukasKalbertodt avatar Jul 07 '15 20:07 LukasKalbertodt

Yeah, but you said: "but mainly I didn't do it for this reason: I can't test it." With openshift you (or other) can test it free ;-)

rockneurotiko avatar Jul 07 '15 20:07 rockneurotiko

Oh now I get, what you're saying. But I don't really want to push every time I want to test it. But I consider doing this the next time I can spare some time for this project ...

LukasKalbertodt avatar Jul 07 '15 20:07 LukasKalbertodt

Nice!

Just as a side note, to test in openshift you don't push to the main repo, you push to a git created for the "gear" deployed.

rockneurotiko avatar Jul 07 '15 20:07 rockneurotiko

Not sure of the status of this feature right now, but Telegram recently added support for self-signed certs. https://core.telegram.org/bots/self-signed

TheReverend403 avatar Oct 22 '15 23:10 TheReverend403

Sweet, thanks for the bump! Will look into it sometime soon, I think.

LukasKalbertodt avatar Oct 22 '15 23:10 LukasKalbertodt

Lets encrypt allows you to automatically create certificates for your own domains.

bjorn3 avatar Jan 02 '17 14:01 bjorn3