Closed Bug 1756709 Opened 3 years ago Closed 3 years ago

HTTP/3 is not working, not behind a firewall or restrictive DNS

Categories

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

Firefox 99
ARM64
macOS
defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: u673061, Assigned: kershaw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

Attached file HTTP logs

My firewall and network and ISP don't block QUIC/HTTP3 traffic and UDP port 443 outgoing is normal because I can use quiche to connect to those QUIC/HTTP3 supported servers

However, https://cloudflare-quic.com is still showing that I am not using QUIC/HTTP/3

I have tried flipping the following prefs on and off

network.echconfig.enabled
network.dns.http3_echconfig.enabled

and adjusting network.dns.httpssvc.http3_fast_fallback_timeout to much higher values, but it still is no use.

But surprising HTTP/3 or QUIC works intermittently when just starting up and first visits a website

How is this supposed to happen?

Attachment #9265065 - Attachment mime type: application/octet-stream → text/plain
Blocks: QUIC

Interestingly on, another Android phone with Firefox Nightly installed on the same Wi-Fi network, HTTP/3 is working

Based on the log, I can see two reasons that prevent Firefox using HTTP/3 to connect.

  1. Shift Reload happened, in this case, Firefox clears all alt-svc mappings. Without the mapping of h3 and cloudflare-quic.com, FIrefox can only use HTTP/2 to connect.
2022-02-22 22:04:16.759149 UTC - [Parent 7373: Socket Thread]: V/nsHttp nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup
2022-02-22 22:04:16.759151 UTC - [Parent 7373: Socket Thread]: V/nsHttp ConnectionEntry::ClosePersistentConnections [ci=.S.......[tlsflags0x00000000]cloudflare-quic.com:443 <ROUTE-via cloudflare-quic.com:443> {NPN-TOKEN h3}^partitionKey=%28https%2Ccloudflare-quic.com%29]
  1. There is already a HTTP/2 connection to cloudflare-quic.com and we received alt-svc response (alt-svc: h3=":443") from cloudflare-quic.com indicates that this site supports HTTP/3, so Firefox tries to create a speculative connection to verify HTTP/3. But, Firefox fails to create to this speculative connection since there is already an HTTP/2 connection.
2022-02-22 22:04:16.848008 UTC - [Parent 7373: Socket Thread]: V/nsHttp ConnectionEntry::RestrictConnections 144f7ec80 .S.......[tlsflags0x00000000]cloudflare-quic.com:443 <ROUTE-via cloudflare-quic.com:443> {NPN-TOKEN h3}^partitionKey=%28https%2Ccloudflare-quic.com%29 restricted due to active >=h2
2022-02-22 22:04:16.848009 UTC - [Parent 7373: Socket Thread]: V/nsHttp DoSpeculativeConnectionInternal Transport not created due to existing connection count:32

I think what we can improve is about the second reason above. We should allow Firefox to create a speculative connection to verify HTTP/3 even if there is already an available HTTP/2 connection.

Assignee: nobody → kershaw
Severity: -- → S4
Priority: -- → P2
Whiteboard: [necko-triaged]

It turns out that an AltSvcTransaction supposes not to have NS_HTTP_ALLOW_KEEPALIVE flag. Looks like the purpose of this is to bypass the RestrictConnection check.
However, in the constructor of NullHTTPTransaction, NS_HTTP_ALLOW_KEEPALIVE is set again.
I think we need to fix this.

With this patch, we'll skip the RestrictConnections cehck when creating a speculative connection for Alt-svc validation.

Hmmm, in Chrome it is the complete opposite - even after Shift or Ctrl+F5 reload, HTTP/3 still works

Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6adb5930b38 Remove NS_HTTP_ALLOW_KEEPALIVE for AltSvcTransaction, r=necko-reviewers,dragana
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: