Reputation: 31
I'm making a discord bot using python. When I try to run it to connect my client to discord I get this error:
raise ClientConnectorCertificateError( 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:****)')]
Happens every time I try to run it.
I saw a plausible fix for this which was:
However, when I tried it and then tried to run my bot again I still got the same error.
Dont know if this is relevant but at the start of the error message in the Traceback section it says the first call that started the error is in the last line of my bot's code which is client.run(TOKEN).
I'm using Python 3.8 on Windows 10.
Upvotes: 3
Views: 7629
Reputation: 991
TL;DR Your certificate has expired, and you need to download and install the new one to your local machine by downloading it from the website and installing it into your OS.
This solution is performed using Google Chrome and Windows 10.
Once you install all the certificates required to validate the HTTPS request, your script shouldn't encounter the certificate expired error anymore, until the new certs expire.
You can also check when each cert expires in certmgr.
Upvotes: 4