[Python] SSLCertVerificationError How i can fix?

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    i have some problems, when i start my bot in windows then full work, but when i start in macOS 13.5.1 i have error like this

    during handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/Users/aleksandr/Desktop/allProjectsPy/multiBots/main.py", line 60, in <module>
    asyncio.run(main())
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
    File "/Users/aleksandr/Desktop/allProjectsPy/multiBots/main.py", line 51, in main
    await mbot.get_updates(offset=-1)
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiogram/client/bot.py", line 412, in get_updates
    return await self(call, request_timeout=request_timeout)
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiogram/client/bot.py", line 354, in __call__
    return await self.session(self, method, timeout=request_timeout)
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiogram/client/session/base.py", line 182, in __call__
    return cast(TelegramType, await middleware(bot, method))
    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiogram/client/session/aiohttp.py", line 152, in make_request
    raise TelegramNetworkError(method=method, message=f"{type(e).__name__}: {e}")
    aiogram.exceptions.TelegramNetworkError: ClientConnectorCertificateError: Cannot connect to host api.telegram.org:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1122)')]
    Unclosed client session
    client_session: <aiohttp.client.ClientSession object at 0x7fa618587df0>


    my packeges:

    aiofiles==22.1.0
    aiogram==3.0.0b5
    aiohttp==3.8.5
    aiosignal==1.3.1
    async-timeout==4.0.3
    attrs==23.1.0
    cffi==1.15.1
    charset-normalizer==3.2.0
    cryptography==41.0.3
    frozenlist==1.4.0
    idna==3.4
    magic-filter==1.0.11
    multidict==6.0.4
    peewee==3.16.3
    pycparser==2.21
    pydantic==1.10.12
    pyOpenSSL==23.2.0
    typing_extensions==4.7.1
    yarl==1.9.2


    i try this pip install --upgrade pyOpenSSL and use only pip install -r requiments

    Continue reading...

Compartilhe esta Página