Skip to content
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

[Mac] SSLError #581

Closed
Terranian opened this issue Jan 19, 2017 · 11 comments
Closed

[Mac] SSLError #581

Terranian opened this issue Jan 19, 2017 · 11 comments

Comments

@Terranian
Copy link

I get this everytime I make a new bot. Please help.

> Logging into Discord...
> [19/01/2017 17:30] ERROR red <module> 618: Fatal exception, attempting graceful logout
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiohttp/connector.py", line 601, in _create_direct_connection
>     local_addr=self._local_addr)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 713, in create_connection
>     sock, protocol_factory, ssl, server_hostname)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 736, in _create_connection_transport
>     yield from waiter
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py", line 361, in __iter__
>     yield self  # This tells Task to wait for completion.
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
>     future.result()
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py", line 274, in result
>     raise self._exception
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/sslproto.py", line 492, in data_received
>     ssldata, appdata = self._sslpipe.feed_ssldata(data)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/sslproto.py", line 200, in feed_ssldata
>     self._sslobj.do_handshake()
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 633, in do_handshake
>     self._sslobj.do_handshake()
> ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiohttp/connector.py", line 304, in connect
>     yield from self._create_connection(req)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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.5/lib/python3.5/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:645)]
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "red.py", line 599, in <module>
>     loop.run_until_complete(main(bot))
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
>     return future.result()
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py", line 274, in result
>     raise self._exception
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py", line 241, in _step
>     result = coro.throw(exc)
>   File "red.py", line 584, in main
>     bot=not bot.settings.self_bot)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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.5/lib/python3.5/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.5/lib/python3.5/site-packages/discord/http.py", line 195, in static_login
>     data = yield from self.get(self.ME)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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.5/lib/python3.5/site-packages/aiohttp/client.py", line 555, in __iter__
>     resp = yield from self._coro
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiohttp/client.py", line 198, in _request
>     conn = yield from self._connector.connect(req)
>   File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/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:645)]]
> Task was destroyed but it is pending!
> task: <Task pending coro=<Streams.stream_checker() running at /Users/John/Music/Bot/Red-DiscordBot/cogs/streams.py:417> wait_for=<Future pending cb=[Task._wakeup()]>>
> Red has been terminated. Exit code: 1
> Press enter to continue.
> 
@Twentysix26
Copy link
Member

Windows server?

@Kowlin
Copy link
Member

Kowlin commented Jan 20, 2017

The connection to Discord is being blocked on the server, please check your firewall settings, and so on. If you're running Windows Server. You'll have to visit the Discord site with IE on the server to acquire the SSL certificate.

@Terranian
Copy link
Author

This is on a mac, and I will check my firewall, when I get home tomorrow.

Thanks.

@Twentysix26
Copy link
Member

I don't know if you still have the issue but this is probably it:
Rapptz/discord.py#423 (comment)

@Twentysix26 Twentysix26 changed the title Error when Running [Mac] SSLError Jan 31, 2017
@Twentysix26
Copy link
Member

Adding more informations:
Apparently navigating to Applications/Python 3.6/ and double clicking Install Certificates.command fixes this issue

@ad-kan
Copy link

ad-kan commented Apr 2, 2020

Adding more informations:
Apparently navigating to Applications/Python 3.6/ and double clicking Install Certificates.command fixes this issue

Thank you, this works perfectly. Running 3.8.2.

@Mimmob07
Copy link

When I go to Applications/Python 3.8.2/ and open the InstallCertificates.command it gives me this error

Collecting certifi
 Using cached certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
Installing collected packages: certifi
 Attempting uninstall: certifi
   Found existing installation: certifi 2017.11.5
   Uninstalling certifi-2017.11.5:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/certifi-2017.11.5.dist-info/RECORD'
Consider using the `--user` option or check the permissions.

WARNING: You are using pip version 20.1; however, version 20.1.1 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m pip install --upgrade pip' command.
Traceback (most recent call last):
 File "<stdin>", line 44, in <module>
 File "<stdin>", line 24, in main
 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
   raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8', '-E', '-s', '-m', 'pip', 'install', '--upgrade', 'certifi']' returned non-zero exit status 1.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
please help i just want to build my bot : (

@Jackenmen
Copy link
Member

This is a very old issue and support questions shouldn't be asked in GH issues. If you need help setting up Red, you should ask on our discord server: https://discord.gg/red

@Mimmob07
Copy link

sorry I will make a new issue or join the server(or both)

@MysteryCoder456
Copy link

Adding more informations:
Apparently navigating to Applications/Python 3.6/ and double clicking Install Certificates.command fixes this issue

Thank you, you are a kind programmer.

@theguynamestan
Copy link

Adding more informations:
Apparently navigating to Applications/Python 3.6/ and double clicking Install Certificates.command fixes this issue

confirmed that this worked. using Mac Catalina, python 3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants