MikaYeghi
MikaYeghi

Reputation: 80

Using Self-Signed SSL certificate

I am developing an online-shop based on a Telegram Bot, and I need to host it on a VPS. What are the dangers if I use a self-signed SSL certificate?

I found online that there's a MiTM attack threat, but I couldn't find a detailed explanation on how it can be avoided when using a self-signed SSL.

For example, will it help if all requests are sent to/from a URL of type: www.example.com/?

Upvotes: 0

Views: 146

Answers (1)

President James K. Polk
President James K. Polk

Reputation: 42008

This is based on my reading of the Telegram Bot API.

There are two ways to control your bot, both of which involve "reasonably" secure protocols that are hard to man-in-the-middle (MITM). First, all communications with the Telegram server using the Bot API uses HTTPS. You must authenticate the Telegram server by doing a proper certificate chain validation. Telegram both authenticates you and identifies you by checking the token you supply in your HTTP request. This token was given to you when you created your bot and must remain a secret.

In addition, you may also elect to receive updates via a webhook. This basically involves you running an HTTPS server using a self-signed certificate. However, you provide your certificate to Telegram over a secure mutually authenticated connection when you setup the webhook, so this eliminates the MITM threat. The Telegram documentation suggests a method you can use to verify that the connection is coming from Telegram.

CAVEATS:

  1. I've never implemented a Telegram Bot, so this is just based on reading the Docs.
  2. Simply because it looks secure to me after 10 minutes of study doesn't make it so. Since this is a unique protocol within HTTPS I would want to see some expert analysis before I'd be confident.

Upvotes: 1

Related Questions