multiformats / py-multiaddr

multiaddr implementation in Python
https://multiformats.io/
Other
33 stars 23 forks source link

Infura IPFS SSL certificate verification fails #50

Closed njgheorghita closed 5 years ago

njgheorghita commented 5 years ago

Hello!

I just updated to ipfshttpclient from py-ipfs-api and I'm now having trouble connecting to Infura's IPFS endpoint.

Infura IPFS multiaddr: base_uri = "/dns/ipfs.infura.io/tcp/5001/https"

Connecting to Infura IPFS

self.client = ipfshttpclient.connect(self.base_uri)

Stack trace:

ethpm/backends/ipfs.py:60: in __init__
    self.client = ipfshttpclient.connect(self.base_uri)
venv/lib/python3.6/site-packages/ipfshttpclient/client/__init__.py:102: in connect
    assert_version(client.version()['Version'])
venv/lib/python3.6/site-packages/ipfshttpclient/client/base.py:15: in wrapper
    result = func(*args, **kwargs)
venv/lib/python3.6/site-packages/ipfshttpclient/client/miscellaneous.py:204: in version
    return self._client.request('/version', decoder='json', **kwargs)
venv/lib/python3.6/site-packages/ipfshttpclient/http.py:44: in wrapper
    return func(self, *args, **merged)
venv/lib/python3.6/site-packages/ipfshttpclient/http.py:364: in request
    files, headers, data, timeout=timeout)
venv/lib/python3.6/site-packages/ipfshttpclient/http.py:282: in _request
    timeout=timeout)
venv/lib/python3.6/site-packages/ipfshttpclient/http.py:249: in _do_request
    six.raise_from(exceptions.ConnectionError(error), error)
<string>:3: in raise_from
    ???
E   ipfshttpclient.exceptions.ConnectionError: SSLError: HTTPSConnectionPool(host='ipfs.infura.io', port=5001): Max retries exceeded with url: /api/v0/version?stream-channels=true (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

I'm not sure what I could be doing wrong. There doesn't seem to be any problem with infura's ssl certificates. It appears that the multiaddr is being correctly parsed, since the request is being made to https://ipfs.infura.io:5001/api/v0/version. Any thoughts or ideas on what could be the issue would be great, cheers!

njgheorghita commented 5 years ago

closing bug and moving to py-ipfs-api / ipfshttpclient - thanks!