I tried several WebTranport server examples, but failed to establish a webtransport connection with Chrome 111.
Server examples:
- https://github.com/wegylexy/webtransport/blob/main/ServerDemo/Program.cs
- https://github.com/dotnet/aspnetcore/blob/main/src/Servers/Kestrel/samples/WebTransportSampleApp/Program.cs
- https://github.com/GoogleChrome/samples/blob/gh-pages/webtransport/webtransport_server.py
Clients:
- https://googlechrome.github.io/samples/webtransport/client.html
- https://127.0.0.1/service-tests/webtransport-test/webtransport-test.html
The error was either
net::ERR_CONNECTION_RESET.
WebTransportError: Opening handshake failed.
or
net::ERR_QUIC_PROTOCOL_ERROR.QUIC_TLS_CERTIFICATE_UNKNOWN (TLS handshake failure (ENCRYPTION_HANDSHAKE) 46: certificate unknown).
WebTransportError: Opening handshake failed.
To make self-signed SSL certificate working, I tried using Chrome command line args
--user-data-dir=chromequicdata --origin-to-force-quic-on=localhost:4433 --ignore-certificate-errors-spki-list=Gi/HIwdiMcPZo2KBjnstF5kQdLI5bPrYJ8i3Vi6Ybck=
or passing server certificate hash as WebTransport constructor options
new WebTransport(url, {
serverCertificateHashes: [
{algortithm: 'sha-256', value: decodeBase64('Gi/HIwdiMcPZo2KBjnstF5kQdLI5bPrYJ8i3Vi6Ybck=')}
]
});
Do I have to get a valid SSL certificate to make these server examples working?