Replies: 1 comment
-
If you haven't solved your problem yet, your Python script is failing to connect to Discord’s servers because your system cannot verify Discord’s SSL certificate. This happens when Python’s SSL certificate store is outdated, missing, or improperly configured. The error [SSL: CERTIFICATE_VERIFY_FAILED] means the HTTPS connection is being blocked due to security checks. You can update your certificate by running this command in VSCode (Assuming that your using it) in the terminal. Hope this helps! |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Traceback (most recent call last):
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1122, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs, sock=sock)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1106, in create_connection
transport, protocol = await self._create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1139, in _create_connection_transport
await waiter
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 574, in _on_handshake_complete
raise handshake_exc
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 556, in _do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/branlygomez/Desktop/M7/1/main.py", line 31, in
bot.run("")
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/client.py", line 906, in run
asyncio.run(runner())
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/client.py", line 895, in runner
await self.start(token, reconnect=reconnect)
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/client.py", line 823, in start
await self.login(token)
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/client.py", line 652, in login
data = await self.http.static_login(token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/http.py", line 828, in static_login
data = await self.request(Route('GET', '/users/@me'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/discord/http.py", line 642, in request
async with self.__session.request(method, url, **kwargs) as response:
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 1425, in aenter
self._resp: _RetType = await self._coro
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1406, in _create_direct_connection
raise last_exc
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1375, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/branlygomez/Desktop/M7/1/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1124, in _wrap_create_connection
raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')]
Beta Was this translation helpful? Give feedback.
All reactions