I want to set self signed certificate for my telegram bot webhook. I used this openssl command to create public key as discussed in Marvin's Marvellous Guide to All Things Webhook:
openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out \
YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=example.com"
Then I use curl or postman to set webhook and send certificate. Both of them just give me Webhook was set
but bot doesn't respond. After that I use getwebhookinfo to check the problem.
It returns:
"last_error_message": "SSL error {337047686, error:1416F086:SSL routines:
tls_process_server_certificate:certificate verify failed}",
I googled it but I can't find the solution. Below you can see some extra info.
curl -F "url=https://mydomain.ir/responser.php" -F "certificate=@YOURPUBLIC.pem" https://api.telegram.org/bot.../setWebhook
My public key is in same folder as cmd runs.
My domain also doesn't have a valid ssl certificate so chrome just show up a warning. Your connection is not private
And I am sure about background code that works, because it was tested before.
Thanks for further help.