SSL #12
SSL
#12
Replies: 2 comments
-
|
Привет! Решили вопрос? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
У меня эта ошибка произошла на macOS проблема с сертификатами эту команду используйте в терминале Вместо 3.14 используйте свою версию python, которая у вас установлена |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
При запуске бота пишет ошибку:
Traceback (most recent call last):
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1283, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1113, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1146, in _create_connection_transport
await waiter
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\sslproto.py", line 578, in _on_handshake_complete
raise handshake_exc
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\sslproto.py", line 560, in _do_handshake
self._sslobj.do_handshake()
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1006)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\connection\base.py", line 108, in request
r = await self.bot.session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client.py", line 779, in _request
resp = await handler(req)
^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\client.py", line 734, in _connect_and_send_request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 642, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1209, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1581, in _create_direct_connection
raise last_exc
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1550, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 1285, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host platform-api.max.ru:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1006)')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\sc34globalbot\MAX_TG_BOT\test_ssl.py", line 34, in
asyncio.run(main())
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\sc34globalbot\MAX_TG_BOT\test_ssl.py", line 30, in main
await dp.start_polling(bot)
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\dispatcher.py", line 480, in start_polling
await self.__ready(bot)
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\dispatcher.py", line 217, in __ready
response = await self.bot.get_subscriptions()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\bot.py", line 1006, in get_subscriptions
return await GetSubscriptions(bot=self).fetch()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\methods\get_subscriptions.py", line 44, in fetch
return await super().request(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Global\AppData\Local\Programs\Python\Python311\Lib\site-packages\maxapi\connection\base.py", line 114, in request
raise MaxConnection(f'Ошибка при отправке запроса: {e}')
maxapi.exceptions.max.MaxConnection: Ошибка при отправке запроса: Cannot connect to host platform-api.max.ru:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1006)')]
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000137A8CD6810>
Beta Was this translation helpful? Give feedback.
All reactions