Mehdi
Mehdi

Reputation: 488

Telegram Webhook And Ngrok Not Working Correctly

I have a telegram bot that make with botman , and when i upload it on a website its ok and working very well , but for developing its not good idea that be on website cause of many requests sending to the server ant its block it immedietly .

For developing , i want to use ngrok , i install it on windows and serve the botman on port 8000 and run the ngrok with

ngrok http 8000

Its Works:

enter image description here

And as you can see the connections from telegram recives correctly

But the problem is the telegram bot not responding.

enter image description here

And also i tried this

 ngrok http 8000 -host-header=localhost:8000

What should i do?

Thanks;

Upvotes: 1

Views: 1844

Answers (1)

AhmadReza Molaei
AhmadReza Molaei

Reputation: 489

Why telegram bot not responding 🤕?

Transfer of sensitive information is typically done under the cover of digital certificates. The certificate will help confirm to the recipient that the sender is actually who they claim they are. Digital certificates are issued by certificate authorities.

A list of trusted certificate authorities and their root certificates are installed on a server when a digital certificate is applied to the server. Transactions over regular HTTPS will revert to this list for communication. However, CURL does not follow the rules. You need to tell curl about the ca root certificates.

How to resolve 👍 ?

To resolve the error, you need to define your CURL certificate authority information path

To do that,

  1. Download the latest curl recognized certificates here: https://curl.haxx.se/ca/cacert.pem

In wampServer:

2.1 Place file in the C:\wamp64\bin\php\php*.*.* folder

replace * with your wamp php version.

2.2 Make sure the file mod_ssl.so is inside of C:\wamp64\bin\apache\apache(version)\modules Enable mod_ssl in httpd.conf inside of Apache directory C:\wamp64\bin\apache\apache2.4.27\conf

2.3 Open php.ini and find this line:

curl.cainfo

Change it to:

curl.cainfo = "C:\wamp64\bin\php\php*.*.*\cacert.pem"

In XAMPP server

2.1 Place file in the:

 C:\xampp\php\extras\ssl\

2.2 in your php.ini put this line in this section ("c:\xampp\php\php.ini"):

;;;;;;;;;;;;;;;;;;;;
; php.ini Options  ;
;;;;;;;;;;;;;;;;;;;;

curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
  1. Save and close your php.ini. Restart your webserver and try your request again.

Upvotes: 2

Related Questions