I have an static ip address and I want to use it as Telegram bot webhook. In the other words, my bot application runs on my local system, and I configured my modem to forward requests from that ip address to my local server:port. This method is working for other applications run on my local system, but I have problem with ssl.
For setting webhook, first I generate a Self-signed certificate in this way:
openssl req -newkey rsa:2048 -sha256 -nodes -keyout PRIVATE.key -x509 -days 365 -out PUBLIC.pem -subj "/C=NG/ST=Lagos/L=Lagos/O=YOUR_NAME_OR_COMPANY_NAME/CN=<MY_IP:PORT> OR <MY_IP>"
This generates PUBLIC.pem
file and I send it to setWebhook
api. The result is ok, but I always get below result from getWebhookInfo
method:
{
"ok":true,
"result":{
"url":".../bot/receive",
"has_custom_certificate": true,
"pending_update_count":15,
"last_error_date":1609911454,
"last_error_message":"SSL error {error:14095044:SSL routines:ssl3_read_n:internal error}",
"max_connections":40,
"ip_address":"..."
}
}
Also in my applicaition, I have enabled ssl supprot with .p12
equivalent of .pem
certificate, but not working. Is there any way for doing this? Thanks in advance.