Closed Bug 1774572 Opened 2 years ago Closed 2 years ago

Unable to open websocket session over h2 (RFC 8441)

Categories

(Core :: Networking: WebSockets, defect, P2)

Firefox 101
defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: horia.muntean, Assigned: kershaw)

References

(Regressed 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Steps to reproduce:

I have a server that is RFC 8441 compliant and offers only h2. The server is available in a git repo, in order to run it you have to follow these steps on a linux machine or wsl2 :

Install SDKMAN! from https://sdkman.io/install (this is needed only to install with ease other apps like java and maven; one can install them by other means)

sdk install java 17.0.3-tem
sdk install maven
git clone https://github.com/lachlan-roberts/websocket-http2-embedded-example
cd websocket-http2-embedded-example

Because FF has issues with self signed certificates and this repo uses one with CN=localhost it has to be replaced with another one otherwise FF won't load the main page - so issue another with a different CN:

openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 3650 -out certificate.pem

make sure you will have : Common Name (e.g. server FQDN or YOUR name) []:demo

openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.p12

use 'storepwd' when Enter Import Password: is prompted

cp certificate.p12 src/main/resources/keystore.p12

Add in /etc/hosts an entry for 'demo' and the local IP.

Now run the server

mvn compile exec:java -Dexec.mainClass="org.example.Main"

Open https://demo:8443 in FF and fill the URI field from the main page with wss://demo:8443 and press Join button (this will try to open a wss session)

Actual results:

The websocket session does not open, see attached screen shots (ff-wss.png). In the console there is the following error: Firefox can’t establish a connection to the server at wss://demo:8443/

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0

Expected results:

The websocket session should open as it does when doing the same with Chrome 102.0.5005.115

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36)

The Bugbug bot thinks this bug should belong to the 'Core::Networking: WebSockets' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking: WebSockets
Product: Firefox → Core

This can also be tested with a public server at https://libwebsockets.org/testserver/
WSS/H2 badge does no show if opened with FF.

Successfully replicated.
Websockets over h2 were disabled as per this.

Blocks: 1772204
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee: nobody → kershaw
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2bfa261943a5 Enable websocket over http2, r=edgul https://hg.mozilla.org/integration/autoland/rev/6c7e9cf2f986 Handle the case when the Http/2 server doesn't support websocket, r=edgul
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Regressions: 1807474
QA Whiteboard: [qa-110b-p2]
Regressions: 1815545
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: