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

Can't connect to API over HTTPS #989

Closed
xuhcc opened this issue Mar 13, 2019 · 4 comments · Fixed by ipfs-inactive/ipfs-redux-bundle#25 or #1007
Closed

Can't connect to API over HTTPS #989

xuhcc opened this issue Mar 13, 2019 · 4 comments · Fixed by ipfs-inactive/ipfs-redux-bundle#25 or #1007
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@xuhcc
Copy link

xuhcc commented Mar 13, 2019

When I open Web UI (version 2.4.1), it shows the "Failed to connect to the API." page. IPFS API is located at https://****:5002. In the browser console I see these messages:

Trying IPFS Companion index.js:4
🎛️ Customise your js-ipfs-api options by storing a `ipfsApi` object in localStorage. e.g. localStorage.setItem('ipfsApi', '/ip4/127.0.0.1/tcp/5001') index.js:8
Trying ipfs-api with custom api address /dnsaddr/****/tcp/5002/https index.js:11
Failed to connect to ipfs-api /dnsaddr/****/tcp/5002/https index.js:49
Processing queued call
["add_event",{"key":"IPFS_INIT_FAILED","count":1,"dur":0.012}]

If I replace /dnsaddr/ with /dns4/ then this error gets printed to console (in addition to the above):

Blocked loading mixed active content “http://****:5002/api/v0/stats/bw?stream-channels=true”
  • OS: Linux
  • Browser: Firefox 65.0.2
@lidel lidel changed the title Failed to connect to ipfs-api when configured for custom API address Can't connect to API over HTTPS Apr 8, 2019
@lidel
Copy link
Member

lidel commented Apr 8, 2019

I updated the title to better reflect what is the problem.

@lidel
Copy link
Member

lidel commented Apr 8, 2019

@xuhcc Did you try to manually tell Web UI what is the multiaddr of your API?
Are you able to check if it helps?

Click the status icon in top right:

2019-04-08--17-23-51

And then tweak default multiaddr of your API:

2019-04-08--17-24-25

@xuhcc
Copy link
Author

xuhcc commented Apr 8, 2019

@lidel

Yes. In my case, API address on status page looks like /dns4/***.net/tcp/5002/https.
I also tried to remove ipfsApi key from local storage and re-open web UI from IPFS companion.

@lidel lidel added the kind/bug A bug in existing code (including security flaws) label Apr 8, 2019
@lidel
Copy link
Member

lidel commented Apr 8, 2019

Ok, I can confirm there is a bug: https is not picked up from multiaddr, http is used in API test instead (call to /api/v0/stats/bw)

1-2019-04-08--17-48-29
2-2019-04-08--17-48-54

It seems multiaddr is passed to js-ipfs-http-client as-is: ipfs-redux-bundle/js-ipfs-api/index.js, may require an upstream fix.

Update: I can confirm, passing multiaddr to js-ipfs-http-client does not respect protocol: js-ipfs-http-client/src/index.js#L27-L28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
2 participants