I want to create a BOT for Telegram, but I have issues in sending my public.key file to telegram. I have a vps and the last version of directadmin installed on it. I purchased a free IP and assigned it to one of "my users" which I'm going to use for creating my bot. I created a letsencrypt certificate for it and now it comes up properly with https protocol. Then I Created a bot at BotFather and received my BOT token and put my public.key file some where in that user's public_html directory. I opened putty, connected to my vsp and typed these curl commands but still get a error 400 from telegram. here's the command I used:
curl -F "url=https://mybot_url" -F "certificate=@/home/user/domains/user's_domain/public_html/bots/public.key" https://api.telegram.org/bot<Token>/setWebhook
I would be thankful if someone help me fix it :)
I solved this issue by removing letsencrypt plugin and using cloudflare instead of it.