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

StreamConn CERTIFICATE_VERIFY_FAILED #431

Open
nvnk3 opened this issue Feb 4, 2024 · 0 comments
Open

StreamConn CERTIFICATE_VERIFY_FAILED #431

nvnk3 opened this issue Feb 4, 2024 · 0 comments

Comments

@nvnk3
Copy link

nvnk3 commented Feb 4, 2024

Hello,

I'm trying to use "StreamConn" like following way by manually setting valid did and access_token and I getting this ssl error, will you let me know what am I missing here?

Traceback (most recent call last):
  File "/Users/nk/Development/NKATS/research/options2/auto/mqtt/webull/quotes.py", line 42, in <module>
    conn.connect(did, access_token=access_token)
  File "/Users/nk/Development/NKATS/research/options2/auto/mqtt/webull/webull/streamconn.py", line 171, in connect
    self.client_order_upd.connect('wspush.webullbroker.com', 443, 30)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
           ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/paho/mqtt/client.py", line 1073, in reconnect
    sock.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1346, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)
from webull import StreamConn, webull

def on_price_message(topic, data):
    print (data)
	#the following fields will vary by topic number you recieve (topic 105 in this case)
    print(f"Ticker: {topic['tickerId']}, Price: {data['deal']['price']}, "
        + f"Volume: {data['deal']['volume']}, Trade time: {data['tradeTime']}")
	#all your algo precessing code goes here

def on_order_message(topic, data):
    print(data)

conn = StreamConn(debug_flg=True)

conn.price_func = on_price_message
conn.order_func = on_order_message

did='m5wraqr77pafi34qmyio7w5ote35l1a5'
access_token="dc_us_tech1.17d653bbc96-cf243ff9dab58732a07a1d56d3ec5563"

conn.connect(did, access_token=access_token)
conn.subscribe(tId='913256135') #AAPL
conn.run_loop_once()
conn.run_blocking_loop()
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

1 participant