Skip to content

Commit

Permalink
Bug 1873461 - Add pref for resolving HTTPS records using native resol…
Browse files Browse the repository at this point in the history
…ver on win 10 r=necko-reviewers,jesup

Differential Revision: https://phabricator.services.mozilla.com/D198020
  • Loading branch information
valenting committed Jan 10, 2024
1 parent 1e61fdd commit 6d6b682
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11921,6 +11921,14 @@
value: false
mirror: always

# DnsQuery_A is broken for HTTPS queries on Windows 10.
# Once it gets fixed, we can flip this pref to enable it.
# Changes might not take effect until restart.
- name: network.dns.native_https_query_win10
type: RelaxedAtomicBool
value: false
mirror: always

# When resolving a native HTTPS query with native APIs
# the Android implementation has a max timeout
- name: network.dns.native_https_timeout_android
Expand Down
3 changes: 2 additions & 1 deletion netwerk/dns/nsHostResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ nsresult nsHostResolver::Init() MOZ_NO_THREAD_SAFETY_ANALYSIS {
// For some reason, the DNSQuery_A API doesn't work on Windows 10.
// It returns a success code, but no records. We only allow
// native HTTPS records on Win 11 for now.
sNativeHTTPSSupported = mozilla::IsWin11OrLater();
sNativeHTTPSSupported = StaticPrefs::network_dns_native_https_query_win10() ||
mozilla::IsWin11OrLater();
#elif defined(MOZ_WIDGET_ANDROID)
// android_res_nquery only got added in API level 29
sNativeHTTPSSupported = jni::GetAPIVersion() >= 29;
Expand Down

0 comments on commit 6d6b682

Please sign in to comment.