'SSL Certificates expired' -- using discordpy and selenium

Question: Basically, selenium fires up whenever I run a command through the discord bot, but all of a sudden I received this “SSL certificates verify failed” error and don’t know how to fix it.

the error:

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: certificate has expired (_ssl.c:1007)')]
1 Like

certificate verify failed: certificate has expired (_ssl.c:1007)')]

Bug description:

Expected vs Current Behavior:

Steps to reproduce:

Bug appears at this link: https://replit.com/~?supportform=true

Screenshot(s)/Screen Recording:

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.69

Replit Profile: https://replit.com/@dontaviusjamaur

Question:
I’m getting an SSL No Certificate Error when running the Discord Bot RPG tutorial.

This ran successfully one time, then threw the error.

Repl link/Link to where the bug appears:
https://replit.com/@raiderack/DiscordRPGReplitTutorial
Screenshots, links, or other helpful context:

@Hamza_Shahzad

that appears to be a browser error, what certificate error do you see? CERT_EXPIRED? CERT_NOT_TRUSTED? Try using a different browser or computer.

I’m getting the same error. Looks like it’s a replit-wide error. Hopefully they’ll update their certificates within a few hours.

Question:

Traceback (most recent call last):
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 1050, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 1080, in _create_connection_transport
    await waiter
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/sslproto.py", line 529, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/sslproto.py", line 189, in feed_ssldata
    self._sslobj.do_handshake()
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/ssl.py", line 944, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "main.py", line 232, in <module>
    bot.run(os.environ['TOKEN'])
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/client.py", line 860, in run
    asyncio.run(runner())
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/client.py", line 849, in runner
    await self.start(token, reconnect=reconnect)
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/client.py", line 777, in start
    await self.login(token)
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/client.py", line 612, in login
    data = await self.http.static_login(token)
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/http.py", line 803, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/discord/http.py", line 625, in request
    async with self.__session.request(method, url, **kwargs) as response:
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
    raise last_exc
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 1178, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/home/runner/Zark-Bot/venv/lib/python3.8/site-packages/aiohttp/connector.py", line 982, 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: certificate has expired (_ssl.c:1131)')]

Replit Profile: https://replit.com/@

I’m getting the same error too

I think its because the certificate is not being updated, does the error show up when run on your own computer?

Same thing for me, I tried some workarounds but it’s Replit based I believe…

I thought it was just me. I’m also getting this error and going crazy about it. My code on VSC still works, seems like it’s just an issue with Replit.

I got the same error…
image

yep seems to be a replit issue (correct me if i’m wrong)

hopefully the certificates will be updated within the next few hours

Question:

Certificate expiring issue on my bot how to fix this?

I have escalated this issue to Replit staff.

4 Likes

keep getting an error when i start my bot and it will not start it says about a certificate has expired :

Expected behavior:

Actual behavior:

Steps to reproduce:

Bug appears at this link:

Browser:
OS:
Device ():
Plan (Hacker:

Yep, we are also facing that issue. It’s a replit issue and hopefully they can update their certificates within the next hours

do you know why they need this certificate

thanks! we are waiting ! :stuck_out_tongue:

1 Like
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: certificate has expired (_ssl.c:997)')]

Either Replit or Discord (this is for a discord bot) have an out of date Certificate. Is there anything I can do about this or am I just at the mercy of one of these two realizing it and fixing it?