-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Connect fails for /dnsaddr/.../wss but not /dns[4|6]/../wss #9204
Comments
I am confident this is a libp2p bug, where the dnsaddr code doesn't have the check to not resolve websocket addresses. /cc @marten-seemann |
Was this fixed by libp2p/go-libp2p#1592? |
@marten-seemann I've checked on Kubo 0.15.0-rc1 (which use go-libp2p 0.21 which have the fix according to github) and it reproduce. |
Are you using an nginx in front of your kubo node, or do you have the cert configured in libp2p directly? |
Is this question for me ?
Curl think so. |
fwiw, i confirmed the manual dial to $ dig +short TXT _dnsaddr.elastic.dag.house
"dnsaddr=/dns4/elastic.dag.house/tcp/443/wss/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm"
"dnsaddr=/dns6/elastic.dag.house/tcp/443/wss/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm"
$ ipfs swarm connect /dns4/elastic.dag.house/tcp/443/wss/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm
connect QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC success
$ ipfs swarm peers | grep QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC
/ip4/104.18.21.126/tcp/443/wss/p2p/QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC The error occurs only when $ ipfs swarm connect /dnsaddr/elastic.dag.house/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm
Error: connect QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC failure: failed to dial QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC:
* [/ip6/2606:4700::6812:157e/tcp/443/wss] dial tcp [2606:4700::6812:157e]:443: connect: network is unreachable
* [/ip6/2606:4700::6812:147e/tcp/443/wss] dial tcp [2606:4700::6812:147e]:443: connect: network is unreachable
* [/ip4/104.18.20.126/tcp/443/wss] remote error: tls: handshake failure
* [/ip4/104.18.21.126/tcp/443/wss] remote error: tls: handshake failure (we did not hit the problem with |
❯ js-ipfs swarm connect /dnsaddr/elastic.dag.house/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm
The dial request has no valid addresses
❯ js-ipfs swarm connect /dns4/elastic.dag.house/tcp/443/wss/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm
/dns4/elastic.dag.house/tcp/443/wss/p2p/QmQzqxhK82kAmKvARFZSkUVS6fo9sySaiogAnx5EnZ6ZmC |
@marten-seemann unfortunately libp2p/go-libp2p#1592 is insufficient. There were a couple deficiencies called out in the PR libp2p/go-libp2p#1592 (comment) (e.g. #9199 and this). I suspect @olizilla is correct in that the peerstore is storing any "root" address and all fully resolved addresses but none in the middle which is what would be needed under the current setup in go-libp2p. Although being smarter about address resolution (e.g. as suggested in libp2p/go-libp2p#1597 and libp2p/go-libp2p#1592) would be better. |
Right, libp2p/go-libp2p#1597 would be the right fix for that. At the moment, we're aggressively resolving any address down to the IP. What we should do is resolve |
If done incorrectly this would create issues with #9199, the transport magic DI code would need to support a new resolver interface so the transport can call into the DoH implementations we may use. |
@Jorropo AFAICT that doesn't appear related to this issue, it's just a separate issue related to #9199 that already exists. Also a PR dealing with DI code is already linked from that PR libp2p/go-libp2p#1607. |
2022-10-04: is anyone dependent on this landing before IPFS Camp 2022 (e.g., have a talk dependent on web sockets)? |
@BigLep This should have been fixed by go-libp2p v0.23. libp2p/go-libp2p#1597, to be more specific. |
Checklist
Installation method
ipfs-update or dist.ipfs.tech
Version
Config
No response
Description
We have a dnsaddr txt record configured to point to dns4 & dns6 mulitaddrs.
swarm connect
fails:The intention is to let the users node pick either ip4 or ip6.
However attempting to connect directly to the /dns4 multiaddr directly succeeds:
It's expected that connecting to the /dnsaddr also succeeds, but it appears to be over-resolving to the /ip multiaddr and losing the domain info needed to satisfy tls.
The text was updated successfully, but these errors were encountered: