Telegram bot webhook giving SSL error

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: asset.money

I ran this command: I ran a command for setting Telegram bot webhook. This worked fine but when I ran the command to getWebHookInfo I got an error. The Telegram bot is not being able to use the webhook to access the server endpoint at asset.money/telegram-webhook.

It produced this output: After using getWebHookInfo I get the following error:
{
ok: true,
result: {
url: "asset.money/telegram-webhook",
has_custom_certificate: false,
pending_update_count: 1,
max_connections: 40,
ip_address: "18.119.100.180",
allowed_updates: [
"message",
"callback_query"
]
}
}

My web server is (include version): Apache Server (Latest version)

The operating system my web server runs on is (include version): Linux Ubuntu (Latest)

My hosting provider, if applicable, is: AWS

Could someone please help me understand if this is an error caused due to not having a self-signed SSL certificate, and if so how do I make my current certificate self-signed and if there is any work around or security issues I must take into consideration while doing the same?
Thank you :slight_smile:

2 Likes

that doesn't look like an error to me.

2 Likes

The webhook was working fine before this message started getting displayed. If you could help me out as to what could be the possible reason for the webhook to stop working, I would most definitely appreciate that :slight_smile:

1 Like

where does that message appear?

2 Likes

This message appears when I use the getWebHookInfo for the Telegram bot that I created. I use a GET request so it gets displayed on the browser.
The get request endpoint is:
https://api.telegram.org/bot<my_bot_id>/getWebhookInfo

1 Like

and does the bot work?

2 Likes

Yup it was working fine until yesterday. Today when I tried giving commands to the bot it didnt reply so I checked the webhook status to which I received the above reply.

1 Like

I set up the bot on 2nd April 2022 and received proper messages till yesterday. Today it stopped working. I also reset the webhook but that too didn't solve the issue.

1 Like

Did you edit some configuration on your webserver? I get an html page on the webhook endpoint.

2 Likes

Nope, the configuration is unchanged, the webserver redirects the requests to the backend API running on port 8000 on the server. This is also a POST endpoint, therefore you get an HTML page since we have created the frontend in a such a way that if a GET request is sent to a non-existent route, it will send a NGMI or Not found static html page in response.

1 Like

We have made use of build folder in React using npm run build, then add the build folder to Node.js app's root folder and serve these static files directly from the build folder whenever anyone tries to visit asset.money. The node app runs on port 8000 on the server.

1 Like

ok, try sending a post request yourself. (I have no idea of the right payload)

2 Likes

Are you sure about this?\

% openssl s_client -connect asset.money:8000
140202948429184:error:0200206E:system library:connect:Connection timed out:../crypto/bio/b_sock2.c:110:
140202948429184:error:2008A067:BIO routines:BIO_connect:connect error:../crypto/bio/b_sock2.c:111:
connect:errno=110
1 Like

Actually, the payload is sent by the Telegram bot to the server end point and it contains the updates to the bot, the payload consists of the chatid where the message has been sent to the bot, the commands in the message, the message txt. What the endpoint does is that it sees what command has been sent, then according the command a database check is made and user is added or removed from a subscription list. The commands are /start or /stop. For each command, there is a message that the telegram bot sends to the user. For example, if the user is subscribing for the first time a welcome message is sent, if the user wants to leave the subscription a goodbye message is sent and if an already subscribed user tries to subscribe again, it send a message saying you have already subscribed.

1 Like

Could I know what this error means? I have seen such an error for the first time

1 Like

I know.

I'm asking you to impersonate the telegram server and send a request to your webhook.

2 Likes

It means nothing is responding to me on port 8000. Is your app running? Is your firewall allowing it? Are you filtering some countries?

Your firewall is not allowing it indeed, if it's running:

% nmap -p1-65532 asset.money
Starting Nmap 7.92 ( https://nmap.org ) at 2022-04-08 15:08 CEST
Nmap scan report for asset.money (18.119.100.180)
Host is up (0.13s latency).
rDNS record for 18.119.100.180: ec2-18-119-100-180.us-east-2.compute.amazonaws.com
Not shown: 65529 filtered tcp ports (no-response)
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 215.70 seconds
2 Likes

Is that all internal to the server or can port 8000 be accessed from the Internet?

3 Likes

Let me check with my senior and get back to you with this, actually I am not in control of the server at the moment. Although as long as I remember such filtering according to countries etc is not present. Also the app is running fine on https://asset.money. If so I might have to see for any issues in the server configurations.

1 Like

The get requests can be accessed on port 8000 from the Internet. The post requests will result in getting a static Not found page since there is no corresponding GET route for the POST route

1 Like