-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
We usually resolve dnsaddrs at a higher layer so I'm not sure if this will work without some tweaks to go-libp2p and go-libp2p-swarm. However, I may be wrong. |
@Stebalien I havn't tested this yet but I'm sure there will be no problem with resolving because from my test Edit:
Means transforming dnsaddr to ip. |
If system pool isn't avaible wss can be made but without certificate verification.
Unfortunately, that's what we do, IIRC. However, we may record both... Regardless, I believe you're looking for |
Actualy i'm looking for any of these, the library just use the domain and resolve it after. |
dnsaddr works a bit differently. Given Unfortunately, that means that converting For now, I think the simplest solution is to specify the TLSClientConfig websocket option and pass in a TLS config with |
This was done because of 3 reason : - This is useless for security and was just here to have the same comportement of the browser. - This require some pretty heavy change in libp2p and libp2p-swarm to allow declaration of a protocol requiring dns4|6 addrs not ip. - This save some time by simplyfing testsuite.
@Stebalien today I tryed to make it works with go-libp2p-example, and after a long time of learning what is mod I finaly get it to not work :(. So I think we should rewrite ws[s] addrs like that :
This just have one draw back, you can only register endpoint under / and not in ipfs/endpoint if you would due to MA limitation (except if you can escape / in ma, in this case I'm interested about that). That should be very easy (that a line to change in the dial part and one line in the listen part). So how can I add an string endpoint params to ws[s] and do EDIT 1: Keeping old notation will not be possible anymore because if MA is followed by /ipfs/Qmxxxx libp2p will understand ipfs as endpoint and Qmxxx as protocol. EDIT 2: A much simpler solution is to only allow announce with wss with go-libp2p and not connection and wait until a solution is decided on go-libp2p and go-libp2p-swarm about protocol needing dns<4|6>. EDIT 3: We can also (and that probably the best choice but I don't think it will ever happend) try to lunch a debate in the web certification authority reponsible of mixed content about adding a way to disable it for very targeted things where it can't be made accident (fetch and ws). |
This pr is a duplicate of #15 because it seems dead.
I chosed to only allow connection from dnsaddr (and dns4 and dns6) because wss is for browser and bypass mixed content error, so I recreated this so users will not get confused by working with go-ipfs and not in browser.That require an useless work and complexification of libp2p and libp2p-swarm so that was aborted.
Also certificates came from system and is currently is only avaible on *nix due to a bug in golang's crypto/x509 library. The code need no change when the bug will be fixed to be windows compatible (just recompile). So on windows certificates will not be loaded and tls connection will be made even if certificate is wrong.That not a bug anymore because this fonctionality isn't anymore.
To do :
Fix :
Fix the bug making dns4 and dns6 like dnsaddr (currently its ignoring 4 and 6 and just taking the host)Potential future upgrade :
websocket-secure
or wss protocol code and the host to have a constant one. (doesn't add more config for user, allow to not use a reverse proxy but still require manual approval of certificate)