1
1
1YaN12019-02-04 20:31:59
Python
1YaN1, 2019-02-04 20:31:59

Certificate error when requesting information about telegram bot, what should I do?

I'm new to python and bot development, I'm trying to get at least a regular message from the bot using the code, I don't get any messages when I
request any information about the bot, I get an error - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl. c:1056)
Ref code:

import telebot

import constants

bot = telebot.TeleBot(constants.token)

bot.send_message(chat_id, "test")


upd = bot.get_updates()
print(upd)

at first I thought it was because of the blocking, and tried to do it through a proxy, but nothing happened

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2019-02-04
@1YaN1

The problem is that the SSL certificate of the server or proxy does not pass the check of the library that is responsible for the network connection, since the certificate is self-signed.
The simplest solution (though not optimal) is to disable certificate verification. How to do this in your particular library for Telegram, you need to look in the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question