manzoorwanijk / telegram-bot-api-worker

Take an alternate route to Telegram Bot API :)
118 stars 39 forks source link

TLS handshake Error on server #6

Closed itmanpro closed 1 year ago

itmanpro commented 1 year ago

Hello! Thank you for your codes I used it to make a worker on the Cloudflare and it was successful. But when I used it in a Project, there was two problem: First: I'm getting this error message: ERROR Execution error getUpdates: request call: fasthttp do request: tls: failed to verify certificate: x509: certificate is valid for *.mywebsite.com, mywebsite.com, not api.telegram.org

Second: there is two addresses for telegram bot used in the project, but here on your code I could see just one of them: https://api.telegram.org https://core.telegram.org/bots/api

you covered the first one, but not the second one

cloud you please help me about this? I really need this. Thank you again for all your efforts.

manzoorwanijk commented 1 year ago

Hello,

ERROR Execution error getUpdates: request call: fasthttp do request: tls: failed to verify certificate: x509: certificate is valid for *.mywebsite.com, mywebsite.com, not api.telegram.org

In your project, the API call needs to go to your Cloudflare worker. You can check the worker functioning properly in your browser as given in How it works section.

there is two addresses for telegram bot used in the project, but here on your code I could see just one of them: https://api.telegram.org https://core.telegram.org/bots/api

you covered the first one, but not the second one

The worker will help you with the bot API which is available via https://api.telegram.org/bot.

itmanpro commented 1 year ago

Hello again, I found that the message I was getting from my server about the certificate problem, actually was occurring because of my settings in the hosts file some days ago, I made a change to the hosts file for testing a solution but I forget to undo it, so the error message has been changed since last night, now I'm getting another kind of error message on my server:

ERROR Getting updates: telego: getUpdates(): internal execution: request call: fasthttp do request: dial tcp4 "The government's firewall IP":443: connect: connection refused

manzoorwanijk commented 1 year ago

ERROR Getting updates: telego: getUpdates(): internal execution: request call: fasthttp do request: dial tcp4 "The government's firewall IP":443: connect: connection refused

It means that either the worker URL is not used properly in your project or your host blocks Cloudflare as well.