03
Май
2020

Ошибка при создании Telegram бота: "ssl.SSLCertVerificationError: certificate verify failed: self signed certificate (_ssl.c:1108)"

2020-05-04 20:50:51,959 (util.py:68 PollingThread) ERROR - TeleBot: "SSLError occurred, args=(SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)')),)
Traceback (most recent call last):
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 542, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 341, in _make_request
    self._validate_conn(conn)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 761, in _validate_conn
    conn.connect()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connection.py", line 234, in connect
    self.sock = ssl_wrap_socket(conn, self.key_file, self.cert_file,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\util\ssl_.py", line 279, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 360, in send
    resp = conn.urlopen(
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 574, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\util.py", line 62, in run
    task(*args, **kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 281, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 251, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\apihelper.py", line 199, in get_updates
    return _make_request(token, method_url, params=payload)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\apihelper.py", line 62, in _make_request
    result = _get_req_session().request(method, request_url, params=params, files=files,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 431, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)
"
Traceback (most recent call last):
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 542, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 341, in _make_request
    self._validate_conn(conn)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 761, in _validate_conn
    conn.connect()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connection.py", line 234, in connect
    self.sock = ssl_wrap_socket(conn, self.key_file, self.cert_file,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\util\ssl_.py", line 279, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 360, in send
    resp = conn.urlopen(
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 574, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Gamer/PycharmProjects/untitled2/fsdaf.py", line 16, in <module>
    bot.polling()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 415, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 438, in __threaded_polling
    polling_thread.raise_exceptions()
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\util.py", line 81, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\six.py", line 703, in reraise
    raise value
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\util.py", line 62, in run
    task(*args, **kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 281, in __retrieve_updates
    updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\__init__.py", line 251, in get_updates
    json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\apihelper.py", line 199, in get_updates
    return _make_request(token, method_url, params=payload)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\telebot\apihelper.py", line 62, in _make_request
    result = _get_req_session().request(method, request_url, params=params, files=files,
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Gamer\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 431, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

Источник: https://ru.stackoverflow.com/questions/1119513/%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0-%D0%BF%D1%80%D0%B8-%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B8-telegram-%D0%B1%D0%BE%D1%82%D0%B0-ssl-sslcertverificationerror-certificate-ve

Тебе может это понравится...

Добавить комментарий