-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect to host discordapp.com certificate verify failed #423
Comments
Yeah, I believe the macOS version of python 3.6 is fucked. You might have to stick with a linux or windows machine because all that I've seen doesn't work on my machine (that has the same issue). I have a VPS so it's not much of a problem anyway, but just a heads up. |
Can confirm @ButterCheezii 's statement on my end. Using Python 3.6.0 in PyCharm (and terminal) on 10.10.5 resulted in the same error. Converting the project over to Python 3.5.2 fixed the issue. Didn't have to install a certificate or anything. Still trying to decide whether to use Heroku or pay $3 bucks a month for a VPS from OVH. @Rapptz It may be worth mentioning this in the README |
I looked into this some more. Apparently 3.6 changed the installation process on OS X. When you install there's this piece of information:
When you head over to the ReadMe.rtf file you get more information as well:
Basically navigate to your Kind of a headache on the python dev group but also a pain from Apple's POV for providing deprecated binaries. |
@Rapptz Thank You very much. |
How i install certificate command file in windows 10? |
I have this error on my windows 7 how do I repair it? I can't seem to find Install Certificates.command anywhere. |
Please don't necro old Github issues. This is more a question for the official help server. To answer your question however: the certificate can be located here. Please download and install the certficate and restart your bot. |
Thank you! This is still relevant!!! |
Please don't necro-bump old issues, even if it is just to express gratitude. For the more recent issue (with a root certificate expiration) on Windows, see #4159. |
Still not working for me. I'm getting the same error. Any other suggestions? (Python 3.7) |
Hey guys
So I've just started trying to learn to build a Discord bot today but ran into this issue that's preventing me from running my bot.
I have installed Python 3.6 and the latest version of discord.py. I ran into this SSL certificate issue when I tried to run my bot, which is only a couple of lines.
import stuff...
token = 'my bot token here'
client = discord.Client()
client.run(token)
Instead of logging my bot in, I get the following error messages:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 601, in _create_direct_connection
local_addr=self._local_addr)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 802, in create_connection
sock, protocol_factory, ssl, server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 828, in _create_connection_transport
yield from waiter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 503, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 201, in feed_ssldata
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 304, in connect
yield from self._create_connection(req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 578, in _create_connection
transport, proto = yield from self._create_direct_connection(req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 624, in _create_direct_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 1] Can not connect to discordapp.com:443 [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/lcheng15/Dropbox/DiscordBot/DiscordBot.py", line 14, in
client.run(token)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 519, in run
self.loop.run_until_complete(self.start(*args, **kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 490, in start
yield from self.login(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 416, in login
yield from getattr(self, 'login' + str(n))(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/client.py", line 346, in _login_1
data = yield from self.http.static_login(token, bot=is_bot)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/http.py", line 195, in static_login
data = yield from self.get(self.ME)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/discord/http.py", line 105, in request
r = yield from self.session.request(method, url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 555, in iter
resp = yield from self._coro
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 198, in _request
conn = yield from self._connector.connect(req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 314, in connect
.format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 1] Cannot connect to host discordapp.com:443 ssl:True [Can not connect to discordapp.com:443 [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)]]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x105cb2e80>
I have found others with the same error on the MusicBot's GitHub. They solved it by installing a certificate, which did not solve my problem. BTW, I'm running MacOS Sierra
I would really appreciate it if you guys could give me some help here. It's really frustrating when the first basic step fails. Thanks in advance!
The text was updated successfully, but these errors were encountered: