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

ssl error #2

Closed
kukui opened this issue Aug 19, 2018 · 2 comments
Closed

ssl error #2

kukui opened this issue Aug 19, 2018 · 2 comments

Comments

@kukui
Copy link

kukui commented Aug 19, 2018

  • Coinbase Pro Asyncronous Websocket Client version:
    master 2c3c063

  • Python version:
    Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 19:50:54)
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

  • Operating System:
    macos sierra 10.13.6

  • environment
    fish shell

Description

When running the following script

# heartbeat.py
import asyncio
from copra.websocket import Channel, Client

KEY = '<mykey>'
SECRET = '<mysecret>''
PASSPHRASE = '<mypassphrase>'

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    ws = Client(loop, Channel('heartbeat', 'BTC-USD'))
    try:
        loop.run_forever()
    except KeyboardInterrupt:
        loop.run_until_complete(ws.close())
        loop.close()

I get the following exception related to ssl verification

commmand

python3 heartbeat.py

traceback

Task exception was never retrieved
future: <Task finished coro=<BaseEventLoop.create_connection() done, defined at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py:681> exception=SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)')>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 804, 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 830, in _create_connection_transport
    yield from waiter
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 505, 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 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)

Additional information

When I run this on a docker image https://github.com/docker-library/python/blob/878ffe36c2391279e673a44a011f5c65943b5eb8/3.6/jessie/Dockerfile

It runs without issue so I think it's a macos issue

@tpodlaski
Copy link
Owner

Based on your configuration, your problem sounds a lot like Rapptz/discord.py#423 (comment). Can you verify that you have the certificate installed?

@kukui
Copy link
Author

kukui commented Aug 20, 2018

That was it. thanks!

@kukui kukui closed this as completed Aug 20, 2018
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

2 participants