#๐ python ssl problem
48 messages ยท Page 1 of 1 (latest)
@shy gazelle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
hello could u help me to fix this
thiss is the problem that i get when i run the bot
File "C:\Program Files\Python312\Lib\site-packages\aiohttp\connector.py", line 1027, 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:1000)')]
the bot is not working
i keep get this
Are you using some kind of proxy or vpn?
What operating system it is? I tried to google and it seems in the past a lot of people had this problem on Mac
This issue is not with your bot or with python at all. This is an issue with your OS's ssl certificates (python cannot use them, or they are invalid). This can happen for many reasons really, please specify:
What OS are you using?
Are you running this on your personal or work (company-provided) PC?
its vps im using a vps
What OS?
I don't really know where ssl certificates are on windows and how to update them. Windows seems like a strange choice for a server
Can you access discord.com from the vps?
lemme cheack
Without python?
What library are you using? discord.py?
yup
its discord.py
like is there any way to fix
by telling vps owners
to do
smth
I don't really know, this is an issue with an OS component and i don't know what's causing it. You may try to use non-system certificates, but this is kind of a hacky solution
You can try pip install certifi and adding
import certifi
import os
certfile = certifi.where()
os.environ["SSL_CERT_FILE"] = certfile```
This may or may not work (discord.py, as any other library, may choose not to respect this setting)
Also this isn't recommended, as now the OS cannot update certificates for you, so you may need to
pip install -U certifi manually in the future
Remember, this is kind of a security issue
So either update the package once in a while
!close
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.