yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.11k stars 1.49k forks source link

Getting Error: unable to get local issuer certificate #741

Open VivekTodur opened 4 years ago

VivekTodur commented 4 years ago

Hi, I am getting this error even with the simple example script.

DEBUG=* node test.js has resulted in the following lines,

node-telegram-bot-api polling with options: {"offset":0,"timeout":10} +0ms
  node-telegram-bot-api HTTP request: {"form":{"offset":0,"timeout":10},"method":"POST","url":"https://api.telegram.org/bot_MY_TOKEN_KEY/getUpdates","simple":false,"resolveWithFullResponse":true,"forever":true} +0ms
  node-telegram-bot-api polling error: EFATAL: Error: unable to get local issuer certificate +978ms
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: unable to get local issuer certificate"}
kamikazechaser commented 4 years ago

Are you using a self signed certificate? If so please check into Telegram API docs on how to correctly configure it.

VivekTodur commented 4 years ago

No not using anything... Using as is in the example.. with relevant token key.

On Mon, 2 Sep 2019, 6:45 pm Mohammed Sohail, notifications@github.com wrote:

Are you using a self signed certificate? If so please check into Telegram API docs on how to correctly configure it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yagop/node-telegram-bot-api/issues/741?email_source=notifications&email_token=AC4CFXSUPVIEWW3JV6SJ6RLQHUGYFA5CNFSM4IOFBCPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5VZMRA#issuecomment-527144516, or mute the thread https://github.com/notifications/unsubscribe-auth/AC4CFXT7HOXQREWBWIKU4BLQHUGYFANCNFSM4IOFBCPA .

stylepatrick commented 4 years ago

Hello, i am getting the same issue. Is there a way to solve it? I am not using a self signed certificate.

VivekTodur commented 4 years ago

No, I couldn't able to identify the issue, but it's happening with only node v12. On a machine loaded with node 10 it is working fine. So I assume some issue with node configuration. Please suggest which configuration should be modified to avoid this error on node 12.

Thanks.

stylepatrick commented 4 years ago

Hello, thanks for your answer. I will try with an older node version.

juandelacruz-calvo commented 2 years ago

For anyone getting to this post in the future. The problem usually relates to the laptop you are using. Some companies install security software that replaces the Server certificates for specific domains in an attempt to obtain the information of the reques.t In my case it was Cisco Umbrella software. So usually executing your code in a different computer that doesn't have that kind of software fixes the issue.