问题
I have been working on a bot and last night it was working just fine operating as needed but this morning when I opened the bot in my terminal I got this following error:
Traceback (most recent call last):
File "d:/Documents/Bots/DS BOT/bot.py", line 58, in <module>
bot.run(token, bot=False)
File "C:\Python38\lib\site-packages\discord\client.py", line 640, in run
return future.result()
File "C:\Python38\lib\site-packages\discord\client.py", line 621, in runner
await self.start(*args, **kwargs)
File "C:\Python38\lib\site-packages\discord\client.py", line 584, in start
await self.login(*args, bot=bot)
File "C:\Python38\lib\site-packages\discord\client.py", line 442, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Python38\lib\site-packages\discord\http.py", line 261, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Python38\lib\site-packages\discord\http.py", line 165, in request
async with self.__session.request(method, url, **kwargs) as r:
File "C:\Python38\lib\site-packages\aiohttp\client.py", line 1012, in __aenter__
self._resp = await self._coro
File "C:\Python38\lib\site-packages\aiohttp\client.py", line 480, in _request
conn = await self._connector.connect(
File "C:\Python38\lib\site-packages\aiohttp\connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Python38\lib\site-packages\aiohttp\connector.py", line 858, in _create_connection
_, proto = await self._create_direct_connection(
File "C:\Python38\lib\site-packages\aiohttp\connector.py", line 1004, in _create_direct_connection
raise last_exc
File "C:\Python38\lib\site-packages\aiohttp\connector.py", line 980, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "C:\Python38\lib\site-packages\aiohttp\connector.py", line 938, in _wrap_create_connection
raise ClientConnectorCertificateError(
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)')]
My token is up to date, I have the latest versions of both Discord.py and python
any help is greatly appreciated
回答1:
Since you are using Windows,
Open Internet Explorer preferably as Administrator
Open discord.com
On address bar, click on the lock icon
Click on Install Certificates and install the certificate
Probably you are facing the problem because they were using Sectigo Certificate which expired on 30th May 2020.
来源:https://stackoverflow.com/questions/62107572/discord-py-sslcertverificationerror