Closed Bug 1873461 Opened 2 years ago Closed 2 years ago

Add pref for resolving HTTPS records using native resolver on win 10

Categories

(Core :: Networking: DNS, task, P3)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

In bug 1852900 we added the ability for Firefox to use the native OS resolver for HTTPS record resolution.
However, we discovered that DnsQuery_A doesn't return a proper result on windows 10.

Here's the report we made to microsoft:


When using the DNS APIs in Windows we've discovered some unexpected behaviour that's only happening on Windows 10.
In particular it's about DnsQuery_A [1] being used to resolve HTTPS records. The following snippet of code works correctly on Windows 11, but on Windows 10 the call to DnsQuery_A returns ERROR_SUCCESS, but the result is still NULL.
I have checked Wireshark, and the HTTPS request is sent and a response is received.

  PDNS_RECORD result = nullptr;
  DNS_STATUS status =
      DnsQuery_A(host.get(), nsIDNSService::RESOLVE_TYPE_HTTPSSVC /* 65 */,
                 DNS_QUERY_STANDARD, nullptr, &result, nullptr);
  if (status != ERROR_SUCCESS) {
    LOG("DnsQuery_A failed with error: %ld\n", status);
    return NS_ERROR_UNKNOWN_HOST;
  }

  LOG("result %p", result);

While I don't expect the Windows 10 implementation to know how to parse HTTPS/SVCB records I think it should still let me access the response as DNS_UNKNOWN_DATA, and that the response shouldn't be null.
Is this a known issue with DnsQuery_A or otherwise a limitation that is not documented?
For reference, my OS version is Windows 10 Pro / OS build 19045.3693 / Feature Experience Pack 1000.19053.1000.0

[1] https://learn.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsquery_a


Assuming that Microsoft will eventually fix the issue on windows 10, we should add a pref that allows the resolution to happen, as it's currently hardcoded to only allow windows11

https://searchfox.org/mozilla-central/rev/f961e5f2a22f4d41733545190892296e64c06858/netwerk/dns/nsHostResolver.cpp#238

sNativeHTTPSSupported = mozilla::IsWin11OrLater();
Assignee: nobody → valentin.gosu
Status: NEW → ASSIGNED
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/58ede87a1f8a Add pref for resolving HTTPS records using native resolver on win 10 r=necko-reviewers,jesup
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: