TL;DR Webtransport does work in chromium but not in firefox.
I started a kubo node locally, it exposes these multiaddresses:
/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv
/ip4/127.0.0.1/udp/4001/quic-v1/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv
/ip4/127.0.0.1/udp/4001/quic-v1/webtransport/certhash/uEiCQEENr7FShHOkuCAUCgW-oahGIGj0Mk3tOHXQjrsWGWQ/certhash/uEiCG3LMdW9dtRC_kXft2TlE66kZ4RX1MzQksLwxRgbJMVw/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv
Then I initialize a webtransport libp2p connection (in Helia):
const local_peer = [
'/ip4/127.0.0.1/tcp/4001/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv',
'/ip4/127.0.0.1/udp/4001/quic-v1/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv',
'/ip4/127.0.0.1/udp/4001/quic-v1/webtransport/certhash/uEiCQEENr7FShHOkuCAUCgW-oahGIGj0Mk3tOHXQjrsWGWQ/certhash/uEiCG3LMdW9dtRC_kXft2TlE66kZ4RX1MzQksLwxRgbJMVw/p2p/12D3KooWF44SaSomGuUSNycgpkRwQcxcsMYeNbtn6XCHPR2ojodv'
]
const libp2p = await createLibp2p({
peerDiscovery: [
bootstrap({
list: local_peer
})
],
transports: [webTransport()],
connectionGater: {
denyDialMultiaddr: async () => false
}
})
This works well in chromium, I see this connection in the network tab
https://127.0.0.1:4001/.well-known/libp2p-webtransport?type=noise
But this does not work in firefox, I get this error:
// WebTransport connection rejected
WebTransportError { source: "session", streamErrorCode: null, name: "WebTransportError", message: "WebTransport connection rejected", code: 0, result: 0, filename: "", lineNumber: 0, columnNumber: 0, data: null }
Does anybody know where the problem comes from? I’m aware webtransport is only available in a “secure context” (see doc WebTransport - Web APIs | MDN) but it seems the certificate is accepted by chromium and not by firefox.