Open simbleau opened 7 months ago
Furthermore, simply typing this in the console also fails:
>> new WebTransport('https://localhost:5000')
WebTransport { ready: Promise { "pending" }, reliability: "pending", congestionControl: "default", closed: Promise { "pending" }, datagrams: WebTransportDatagramDuplexStream, incomingBidirectionalStreams: ReadableStream, incomingUnidirectionalStreams: ReadableStream }
Uncaught (in promise)
WebTransportError { source: "session", streamErrorCode: null, name: "WebTransportError", message: "WebTransport connection rejected", code: 0, result: 0, filename: "", lineNumber: 0, columnNumber: 0, data: null }
code: 0
columnNumber: 0
data: null
filename: ""
lineNumber: 0
message: "WebTransport connection rejected"
name: "WebTransportError"
result: 0
source: "session"
stack: ""
streamErrorCode: null
<prototype>: WebTransportErrorPrototype { source: Getter, streamErrorCode: Getter, stack: "", … }
More troubleshooting: FF 125 (Stable) also does not work.
Also doesn't work on FF 127 (Nightly)
Looks like a cert issue
Im not aware of any issues with FF webtransport using selfsigned certs.
@cBournhonesque im pretty sure we tested FF too?
Though since the api is still unstable there is the possibility of flags being set wrongly as well as recent api changes in FF (unlikely, but possible i guess).
Looks like a cert issue
What gives you that information from the stack trace? I might not be seeing it.
Also, it works on Chrome, as mentioned. So I'm dually confused then if it's a cert issue.
I used the generate script.
Its the most likely explanation since the issue occurs during the handshake.
Definitely requires some more testing to confirm though!
Thanks for the report; @Nul-led I haven't tested in Firefox, no.
I'm not entirely sure if the self-signed certificate mechanism is intended for production settings, see this: https://github.com/BiagioFesta/wtransport/issues/130
According to this: https://wpt.fyi/results/webtransport?label=experimental&label=master&aligned serverCertificateHashes should be supported in FF 127
According to this: https://wpt.fyi/results/webtransport?label=experimental&label=master&aligned serverCertificateHashes should be supported in FF 127
I tested FF 127 (Nightly), mentioned earlier. Specifically,
The first connection gives this error: (related to https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader ?)
INFO lightyear/src/connection/netcode/client.rs:521 client connecting to server 127.0.0.1:5000 [1/1] [simple_box-26e93b1803a3aab7.js:494:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
INFO lightyear/src/transport/webtransport/client_wasm.rs:73 Starting webtransport io thread [simple_box-26e93b1803a3aab7.js:494:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
Uncaught TypeError: ReadableStream.getReader: Trying to read with incompatible controller
__wbg_getReader_8788325bd5966555 http://localhost:8080/simple_box-26e93b1803a3aab7.js:1878
__wbg_adapter_84 http://localhost:8080/simple_box-26e93b1803a3aab7.js:265
real http://localhost:8080/simple_box-26e93b1803a3aab7.js:210
[simple_box-26e93b1803a3aab7.js:1878:37](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
INFO lightyear/src/connection/netcode/client.rs:453 client connect failed. connection request timed out
Trying to connect a second times gives the common error:
O lightyear/src/connection/netcode/client.rs:521 client connecting to server 127.0.0.1:5000 [1/1] [simple_box-26e93b1803a3aab7.js:494:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
INFO lightyear/src/transport/webtransport/client_wasm.rs:73 Starting webtransport io thread [simple_box-26e93b1803a3aab7.js:494:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
panicked at lightyear/src/transport/webtransport/client_wasm.rs:84:18:
failed to connect to server: Custom { kind: Other, error: "failed to connect to server: Error(JsValue(WebTransportError: WebTransport connection rejected\n))" }
Stack:
__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f@http://localhost:8080/simple_box-26e93b1803a3aab7.js:519:21
console_error_panic_hook::hook::hbd095300cc1546a2@http://localhost:8080/simple_box-26e93b1803a3aab7_bg.wasm:wasm-function[14621]:0x1772630
core::ops::function::Fn::call::h29984b27337498f0@http://localhost:8080/simple_box-26e93b1803a3aab7_bg.wasm:wasm-function[107601]:0x231d087
std::panicking::rust_panic_with_hook::h1e6ac5d404b8e31b@http://localhost:8080/simple_box-26e93b1803a3aab7_bg.wasm:wasm-function[34675]:0x1f180c6
std::panicking::begin_panic_handler::{{closure}}::h24b0f4622f2766a5@http://localhost:8080/simple_box-26e93b1803a3aab7_bg.wasm:wasm-function[40537]:0x2047936
std::sys_common::backtrace::__rust_end_short_backtrace::h19f35…
[simple_box-26e93b1803a3aab7.js:535:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
Uncaught RuntimeError: unreachable executed
[simple_box-26e93b1803a3aab7_bg.wasm:36840801:1](http://localhost:8080/simple_box-26e93b1803a3aab7_bg.wasm)
Uncaught (in promise)
WebTransportError { source: "session", streamErrorCode: null, name: "WebTransportError", message: "WebTransport connection rejected", code: 0, result: 0, filename: "", lineNumber: 0, columnNumber: 0, data: null }
ERROR No work has been submitted for this frame log.target = "wgpu_core::present";
log.module_path = "wgpu_core::present";
log.file = "/Users/simbleau/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.19.3/src/present.rs";
log.line = 341; 179 [simple_box-26e93b1803a3aab7.js:494:21](http://localhost:8080/simple_box-26e93b1803a3aab7.js)
Its the most likely explanation since the issue occurs during the handshake.
Definitely requires some more testing to confirm though!
How can I help to narrow that down?
Given FF 127 which is supposed to support these certs (thanks @cBournhonesque) doesn't work, does that mean it's a different issue?
Opened this: https://github.com/BiagioFesta/wtransport/issues/166
Note FF doesn't support serverCertificateHashes
according to MDN
I would highly recommend using ACME/LetsEncrypt provided certificates, unless you actually need to subvert Web PKI for security reasons.
Anyone that feels comfortable with testing this with a LetsEncrypt/ACME cert?
I have other wtransport/xwt project that works on FF with ACME and no cert hashes. That said, it still crashes on FF but due to other bug in bevy rendering... So, things are rough :D
@Nul-led did you test that it works on FF?
@cBournhonesque didnt we confirm that server hashes arent supported by FF? whats the point in keeping this open then? maybe close as not planned then 🤔
I'd like to confirm if possible that examples can work on FF if we use a LetsEncrypt/ACME certificate
According to this: https://wpt.fyi/results/webtransport?label=experimental&label=master&aligned serverCertificateHashes should be supported in FF 127
Following this rabbit hole into the linked issued and hg changesets seems to indicate that the parameter should indeed be supported in current Firefox. This is wonderful news.
I came here during an entirely unrelated search and am not a user of this library. Though if I may chime in with my previous WebTransport experiences:
serverCertificateHashes
, which is useful.@ansemjo thanks for the insights :)
I just checked in another project of mine and serverCertificateHashes
does indeed work in Firefox 126:
That uses an entirely ephemeral certificate generated on-the-fly in a Go server.
I'm afraid, I can't help you with this issue at hand because I'm not familiar with this library. But it's not because modern Firefox doesn't support this option in general.
I just checked in another project of mine and
serverCertificateHashes
does indeed work in Firefox 126: That uses an entirely ephemeral certificate generated on-the-fly in a Go server.I'm afraid, I can't help you with this issue at hand because I'm not familiar with this library. But it's not because modern Firefox doesn't support this option in general.
All good, we'll figure it out. Thx for the heads-up tho, its appreciated.
https://github.com/BiagioFesta/wtransport/pull/192 on wtransport
should fix the firefox issue
According to https://caniuse.com/webtransport, FF 124 is supported?
On Firefox 124, MacOS (Silicon), I get a vague WebTransport connection rejected error.
I tried connecting from
[::1]:8080
,localhost:8080
, and127.0.0.1:8080
with Trunk, no dice.Chrome works fine.
Stack trace: