node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Getting Error: unable to get local issuer certificate

Open VivekTodur opened this issue 5 years ago • 6 comments

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"}

VivekTodur avatar Aug 21 '19 10:08 VivekTodur

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

kamikazechaser avatar Sep 02 '19 13:09 kamikazechaser

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

On Mon, 2 Sep 2019, 6:45 pm Mohammed Sohail, [email protected] 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 .

VivekTodur avatar Sep 03 '19 17:09 VivekTodur

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

stylepatrick avatar Oct 28 '19 16:10 stylepatrick

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.

VivekTodur avatar Oct 28 '19 23:10 VivekTodur

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

stylepatrick avatar Oct 31 '19 11:10 stylepatrick

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.

juandelacruz-calvo avatar Jul 24 '21 11:07 juandelacruz-calvo