-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Binance SSL: CERTIFICATE_VERIFY_FAILED #882
Comments
Are you located in China? |
I am located in Australia |
@scoshil can you access it via a public CORS-proxy? bin = ccxt.binance({
'apiKey':BinanceKey1,
'secret':BinanceSecret1,
'proxy': 'https://cors-anywhere.herokuapp.com/', # last slash critical
})
bin.verbose = True
bin.load_markets() |
See also:
Looks like an issue with Anaconda Python certificates or root CA settings... Did you see any options regarding SSL certificates upon installing it? Can you verify that it has access to your system / OpenSSL certificates? |
Did you test that keypair with any other software? Can you clarify how exactly it "works" ? |
I tested that pair with the lib at https://github.com/sammchardy/python-binance and it worked smoothly....haven't looked to see if that lib does anything special with proxies yet, but I didn't configure it any differently to normal. I will look into those links and see if I can fix it this way. cheers |
@scoshil ok, I will check their sources on this issue, to see if there's a workaround for this. Thx! Will get back to you with a followup. |
@scoshil can you paste here your code snippet that you used with https://github.com/sammchardy/python-binance for testing, please? |
do you mean from python-binance? Test code:
Output:
|
Yes, thanks... Does this help with ccxt? |
@kroitor I tried that and it still gives me the same error unfortunately |
@scoshil python-binance works because it uses the |
I'd also suggest to try this: https://stackoverflow.com/questions/33699577/conda-update-failed-ssl-error-ssl-certificate-verify-failed-certificate-ver (or google for more "anaconda SSL" or "conda SSL", "anaconda ssl verify", etc...) If nothing helps, I will do a clean install of Anaconda Python on a virtual Windows PC and will test/fix it then... |
@scoshil can you, please, try reinstalling the anaconda python? (a fresh distrib from their site, if that's ok for you)... you would help us rule out one possible cause of it... |
Thanks I'll try the things you mentioned and report back....may take me a little while to do a clean anaconda install though |
Ok so I tried the following:
Really out of ideas at this point... |
@scoshil ok, thanks so much for your effort and for reporting back! We will have to migrate to |
Thanks! |
@scoshil I can't reproduce the problem from my Windows 10 machine from Russia, I can access Binance normally... As you see, a fresh install of Anaconda3 works on my side... So, maybe you have some certificates that are outdated or something... However, I don't know if it makes sense, because you did a clean reinstall... After installing anaconda I found these two certificates on my setup You can try copying them into your ssl folder to see if they make any difference (save a backup copy of existing certificates beforehand). The fix is on the way... |
Also, if you can, please run the following to see if the issue is indeed related to default SSL certificates: import requests
print(requests.get('https://api.binance.com/api/v1/exchangeInfo').text) Does the above snippet work? |
I have executed what you suggested and this is the output: {"timezone":"UTC","serverTime":1513694282583,"rateLimits":[{"rateLimitType":"REQUESTS","interval":"MINUTE","limit":1200},{"rateLimitType":"ORDERS","interval":"SECOND","limit":10},{"rateLimitType":"ORDERS","interval":"DAY","limit":100000}],"exchangeFilters":[],"symbols":[{"symbol":"ETHBTC","status":"TRADING","baseAsset":"ETH","baseAssetPrecision":8,"quoteAsset":"BTC","quotePrecision":8,"orderTypes": ........ {"filterType":"MIN_NOTIONAL","minNotional":"0.01000000"}]},{"symbol":"OSTBNB","status":"TRADING","baseAsset":"OST","baseAssetPrecision":8,"quoteAsset":"BNB","quotePrecision":8,"orderTypes":["LIMIT","LIMIT_MAKER","MARKET","STOP_LOSS_LIMIT","TAKE_PROFIT_LIMIT"],"icebergAllowed":true,"filters":[{"filterType":"PRICE_FILTER","minPrice":"0.00001000","maxPrice":"10000.00000000","tickSize":"0.00001000"},{"filterType":"LOT_SIZE","minQty":"0.01000000","maxQty":"10000000.00000000","stepSize":"0.01000000"},{"filterType":"MIN_NOTIONAL","minNotional":"1.00000000"}]}]} It seems to work correctly. I'm the one that reported #904 |
@hexdump2002 thanks! That confirms my initial thought. Ok, the fix for this is coming very soon. |
Thanks a lot. We really need it because the library crashes in such basic thing.... By he way, your work with the lib is awesome. Thanks for sharing it! |
@hexdump2002 thank you! Btw, just for completeness, if it's not a secret, what is your country/region/continent? |
Europe/Spain , I will provide anything you need :) |
@kroitor : With no intention of rushing you or anything, do you have any ETA for this bug to be fixed? We are at this stucked now :). |
@hexdump2002 today or tomorrow. |
@kroitor I can confirm I have the same output as @hexdump2002 for the requests code you provided I also tried replacing my ssl certificates and it didn't change anything |
@kroitor also just wanted to echo the thanks for sharing the lib! The work that's been done so far has been great! |
Following up the "switching to requests library" suggestions you commented yesterday. Will this affect the cctx.async part of the library? I mean, requests is not compatible with async, so we will have sync calls whenever we use async or not. Could you give a bit of information about this? |
No, if you mean breaking the async version, it will not affect the ccxt.async. But yes, if you mean switching the async to an async-compatible implementation of requests - it will affect the implementation only. The interface remains the same.
Yes, but we are not going to use the synchronous version of
Nope, you will still have both sync and true-async modes available. Hope it answers your question, let me know if you have more ) |
Yes, I understand what you mean. So, the new fix that will come for this bug (The SSL one) will fix both versions? sync and async? Or you are fixing only the synched part only first? |
Yes, we will fix both of them, however, we are going to upload the sync-fix first, then the async-fix.
Yep, but there will be little to no delay between the sync-fix and the consequent async-fix. We are determined to fix them both now, however, we can't fix them both simultaneously (different underlying implementations), therefore the sync version is expected first, and then the async, second. |
This issue is fixed in version 1.10.436. Can you guys test and verify it, please? We will be thankful for your reports! |
Ok, it seems to work now. If you need me to do any test let me know. Thanks a lot. I will be fully happy when you fix the async version too :D. Good Job! Hopping to see it soon! |
@kroitor Will you let us know here when the async version is fixed? Also a small note, not sure if the SSL issue is related to every exchange, however when running the example async-gdax-fetch-order-book-continously.py it seems to work with GDAX, but not when I change it to binance |
Sure, it is coming next.
Will look into it, thx for reporting. |
@kroitor tested fix and working as expected now! Thanks again! |
I'm trying to connect to binance, and just testing the load_markets function, but I'm getting an SSL error.
And Output:
Not having issues with other exchanges, and this key/secret pair works without ccxt
The text was updated successfully, but these errors were encountered: