-
Notifications
You must be signed in to change notification settings - Fork 1.2k
IPv6 host: OpenError: The operation failed for reasons unrelated to the database itself and not covered by any other error code. #2017
Comments
Was there a stack trace with that error? |
ping @pruflyos |
I do not get that error but this works for me in Firefox: ...but is not considered secure in Chrome and I think we're not properly detecting secure context so webcrypto is failing: @lidel have you seen this before? Shall we open an issue on |
@alanshaw it is a known issue with WebCrypto: it requires Secure Context (deploy over HTTPS or localhost IP). Firefox does not implement secure context requirement for it yet, but there is an open issue to do it. tl;dr to test this without triggering secure context check in Chrome, load test page from localhost IPv6:
Upstream issues:
|
Changes `webcrypto.js` to check for native web crypto availability and falls back to using `window.__crypto` if not available. If the user wants to bring their own Web Crypto API compatible implementation then they simply need to assign it to `window.__crypto` before they start using IPFS. Checks are done in the functions that require web crypto to give the user the flexibility to assign to `window.__crypto` before OR after they import `libp2p-crypto`. It also means that users have the ability to use other exported functions that do not require web crypto without having to worry about sorting their own implementation. We use `window.__crypto` because `window.crypto` is a readonly property in secure context and always readonly in workers. If `window.crypto` and `window.__cypto` are unavailable then an appropriate error message is reported to the user with a `ERR_MISSING_WEB_CRYPTO` code. I've also added documentation to the README. This is a backwards compatible change. closes #149 resolves #105 resolves ipfs/js-ipfs#2017 resolves ipfs/js-ipfs#2153 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
This PR simply detects missing web crypto and throws an error with an appropriate message. This is a stepping stone that will help users understand the problem until we have time to do a refactor of this module and of all the modules that use it to enable optionally passing your own crypto implementation. refs #149 refs #150 refs #105 refs ipfs/js-ipfs#2153 refs ipfs/js-ipfs#2017 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
A better error message will be displayed in future versions of At some point we'll allow passing your own crypto implementation when in insecure contexts (for when you really really still need to do crypto), but that requires a big refactor of the module and of many modules that use it. Considering this particular problem solved for now! |
This PR simply detects missing web crypto and throws an error with an appropriate message. This is a stepping stone that will help users understand the problem until we have time to do a refactor of this module and of all the modules that use it to enable optionally passing your own crypto implementation. refs #149 refs #150 refs #105 refs ipfs/js-ipfs#2153 refs ipfs/js-ipfs#2017 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
This PR simply detects missing web crypto and throws an error with an appropriate message. This is a stepping stone that will help users understand the problem until we have time to do a refactor of this module and of all the modules that use it to enable optionally passing your own crypto implementation. refs libp2p#149 refs libp2p#150 refs libp2p#105 refs ipfs/js-ipfs#2153 refs ipfs/js-ipfs#2017 License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
Type: Bug
Severity: High
Description:
I have a OpenWrt uHTTPd server which is reachable on both IPv4 and IPv6 address. If I put the example file from https://github.com/ipfs/js-ipfs/tree/master/examples/browser-script-tag on that server and access it via IPv4 (http://192.168.1.1/jsipfstest.html) everything is fine. But if I access the same file via IPv6 (http://[6001:3ff0:6dae:0:4819:b1bb:c001:22ac]/jsipfstest.html) the node is not started and the following error is shown in the browser console:
Steps to reproduce the error:
The text was updated successfully, but these errors were encountered: