question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binance, certificate verify failed (_ssl.c:777)

See original GitHub issue

If i get info from Binance, i have error:

ccxt.base.errors.ExchangeNotAvailable: binance GET https://www.binance.com/api/v1/depth?symbol=BCCBTC&limit=100
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mazertwocommented, Nov 3, 2017

Code is simple:

import ccxt
binance=ccxt.binance()
orderbook1 = binance.fetch_order_book('ETH/BTC')

Error:

C:\Python\python.exe C:/Users/1/Desktop/test1.py
Traceback (most recent call last):
  File "C:\Python\lib\urllib\request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "C:\Python\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Python\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Python\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Python\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "C:\Python\lib\http\client.py", line 964, in send
    self.connect()
  File "C:\Python\lib\http\client.py", line 1400, in connect
    server_hostname=server_hostname)
  File "C:\Python\lib\ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "C:\Python\lib\ssl.py", line 814, in __init__
    self.do_handshake()
  File "C:\Python\lib\ssl.py", line 1068, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Python\lib\ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\lib\site-packages\ccxt\exchange.py", line 270, in fetch
    response = opener.open(request, timeout=int(self.timeout / 1))
  File "C:\Python\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "C:\Python\lib\urllib\request.py", line 544, in _open
    '_open', req)
  File "C:\Python\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Python\lib\urllib\request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Python\lib\urllib\request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/1/Desktop/test1.py", line 3, in <module>
    orderbook1 = binance.fetch_order_book('ETH/BTC')
  File "C:\Python\lib\site-packages\ccxt\exchanges.py", line 1868, in fetch_order_book
    }, params))
  File "C:\Python\lib\site-packages\ccxt\exchanges.py", line 2123, in request
    response = self.fetch2(path, api, method, params, headers, body)
  File "C:\Python\lib\site-packages\ccxt\exchange.py", line 239, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "C:\Python\lib\site-packages\ccxt\exchange.py", line 281, in fetch
    self.raise_error(ExchangeNotAvailable, url, method, e)
  File "C:\Python\lib\site-packages\ccxt\exchange.py", line 224, in raise_error
    details,
ccxt.errors.ExchangeNotAvailable: binance GET https://www.binance.com/api/v1/depth?symbol=ETHBTC&limit=100 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)> 
1reaction
mazertwocommented, Nov 3, 2017

Sync. Ccxt 1.9.230

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix CERTIFICATE_VERIFY_FAILED error in websocket ...
I am getting this error which says the SSL Verification is failed. ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ ...
Read more >
How to Fix "App certificate cannot be verified" on Binance
In this video, you will learn how to Fix "App certificate cannot be verified " on Binance and why you getting this error.original...
Read more >
CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c ...
上記のライブラリとapiを用いて、binanceという仮想通貨取引所の仮想通貨の売り価格と買い価格を取得したいのですが、出会ったことのないエラーが出てきており大変困惑し ...
Read more >
Keep getting SSL errors (with some DNS) using binance ...
ERROR :root:Lost connection to Server. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.
Read more >
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed ...
Coding example for the question ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found