-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Bit-z: SSL certificate verification failed (Python) #2459
Comments
Yes, looks like it.
Most often this is caused by an outdated version of Anaconda Python, an update (including dependency packages) may be enough to resolve this. |
I am using python 3.6.4. |
@wntsang4 can you try reinstalling the dependencies with pip? Pay attention to any libssl versions you have installed... this problem is also frequently caused by outdated root CA files that come with your ssl lib. |
aiodns (1.1.1) I tried to reinstall all the dependencies with pip and got below response. Request: GET https://www.bit-z.com/api_v1/tickerall {'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate'} None Response: GET https://www.bit-z.com/api_v1/tickerall 403 {'Date': 'Thu, 05 Apr 2018 16:03:50 GMT', 'Content-Type': 'text/html', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Accept-Encoding', 'X-Via-JSL': '65dea62,-', 'Set-Cookie': '__jsluid=15b89504a0297cad520942db470a0f88; max-age=31536000; path=/; HttpOnly', 'X-Cache': 'error', 'Content-Encoding': 'gzip'} <style> body{ background:#fff; font-family: microsoft yahei; color:#969696; font-size:14px;} .online-desc-con { text-align:center; } .r-tip01 { color: #333; font-size: 18px; display: block; text-align: center; width: 500px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto 15px; } .r-tip02 { color: #585858; font-size: 14px; display: block; margin-top: 20px; margin-bottom: 20px; } #notice-jiasule { word-wrap: break-word; word-break: normal; color:#585858; border:1px solid #ddd; padding:0px 20px 0px 20px } img { border: 0; } .u-ico{ vertical-align: middle; margin-right: 12px;} .btn{ padding: 8px 22px; border-radius: 3px; border: 0; display: inline-block;vertical-align: middle;text-decoration: none;} .btn-g{ background-color: #61b25e; color: #fff;} .report {color: #858585; text-decoration: none;} .report:hover {text-decoration: underline; color: #0088CC;} hr{ border-top: 1px dashed #ddd;} center{ line-height: 48px; color: #919191;} </style> <script type="text/template" id="content_tpl"> <%= error_403 %>�����<%- url %> 客�端���<%- user_agent %> �����<%- now %> �次�件ID <%- rule_id %>
<script>
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd7682ab43891c68a00de46e9ce5b76aa' type='text/javascript'%3E%3C/script%3E"));
</script>
|
Is this URL https://www.bit-z.com/api_v1/tickerall available from the same machine in your browser? |
Yes. It works fine in browser. |
@wntsang4 are you using the sync version or the async version? |
sync version |
Ok, I'll spend some more time debugging it and will get back to you on this issue. This is most likely due to openssl installation that either comes with Anaconda Python or with a dependency... Do you know which version of OpenSSL you have, by the way? |
@wntsang4 can you also try pip-uninstalling the UPD. sorry, plz ignore it, it won't work like that without certifi and without changing the code... |
'OpenSSL 1.0.2k 26 Jan 2017' After uninstalling the certifi package, it shows |
@wntsang4 oh... I'll update it to make certifi optional... |
@wntsang4 can you plz show your instantiation code? (a snippet of code that you're using to reproduce it) |
bitz = ccxt.bitz({ order_book = bitz.fetch_order_book('LTC/BTC', 3) |
bitz = ccxt.bitz({
'apiKey': key,
'secret': secret,
'enableRateLimit': True,
'verbose': True,
'userAgent': 'foobar', # ←-------------------------- add this line (any random user-agent)
})
order_book = bitz.fetch_order_book('LTC/BTC', 3) ↑ Does it work this way? (need to install certifi back) |
It works!! |
Yep, it's a python-specific problem, that is caused by transition to a new format of SSL certificates in the community... Apart from the above workaround we can't really do much about it, because it is far beyond our codebase (it's an issue with certifi + OpenSSL + python-requests), therefore some exchanges with older OpenSSL certificates will require the userAgent, which is very non-intuitive... Hope to resolve it soon. I would close it for now if you don't mind. Feel free to reopen it if needed or just ask questions if you have more. https://www.google.ru/search?q=python+CERTIFICATE_VERIFY_FAILED+777 Thx for your feedback! |
Hi. I just leave comment here. I had the same issue and I didn't do anything about this bug. I guess bitz did some upgrade and broke something. It had been happening for couple days if I correct remember and after that it's gone. |
Thanks for your involvement, @alexsith ! |
Request: GET https://www.bit-z.com/api_v1/tickerall {'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate'} None
ExchangeError ("bitz https://www.bit-z.com/api_v1/tickerall GET HTTPSConnectionPool(host='www.bit-z.com', port=443): Max retries exceeded with url: /api_v1/tickerall (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))",) Error
Is it the same problem?
#882
The text was updated successfully, but these errors were encountered: