diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 6011c0dfeb71..a8310d125eba 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -8839,7 +8839,7 @@ # available. - name: network.dns.upgrade_with_https_rr type: RelaxedAtomicBool - value: false + value: @IS_EARLY_BETA_OR_EARLIER@ mirror: always # Whether to use HTTPS RR as AltSvc diff --git a/netwerk/dns/ChildDNSService.cpp b/netwerk/dns/ChildDNSService.cpp index 145b554b81e4..ebfb4aee2605 100644 --- a/netwerk/dns/ChildDNSService.cpp +++ b/netwerk/dns/ChildDNSService.cpp @@ -18,6 +18,7 @@ #include "mozilla/net/NeckoChild.h" #include "mozilla/net/DNSListenerProxy.h" #include "mozilla/net/TRRServiceParent.h" +#include "nsHostResolver.h" #include "nsServiceManagerUtils.h" #include "prsystem.h" #include "DNSResolverInfo.h" @@ -94,6 +95,11 @@ nsresult ChildDNSService::AsyncResolveInternal( bool resolveDNSInSocketProcess = false; if (XRE_IsParentProcess() && nsIOService::UseSocketProcess()) { resolveDNSInSocketProcess = true; + if (type != nsIDNSService::RESOLVE_TYPE_DEFAULT && + (mTRRServiceParent->Mode() != MODE_TRRFIRST && + mTRRServiceParent->Mode() != MODE_TRRONLY)) { + return NS_ERROR_UNKNOWN_HOST; + } } if (mDisablePrefetch && (flags & RESOLVE_SPECULATE)) { diff --git a/netwerk/test/unit/test_dns_by_type_resolve.js b/netwerk/test/unit/test_dns_by_type_resolve.js index 1df7e796a052..f31325b8c030 100644 --- a/netwerk/test/unit/test_dns_by_type_resolve.js +++ b/netwerk/test/unit/test_dns_by_type_resolve.js @@ -178,27 +178,3 @@ add_task(async function testTXTRecordPushPart2() { .getRecordsAsOneString(); Assert.equal(answer, test_answer, "got correct answer"); }); - -add_task(async function testHTTPSSVCResolve() { - prefs.setCharPref( - "network.trr.uri", - "https://foo.example.com:" + h2Port + "/doh" - ); - let listenerEsni = new DNSListener(); - let request = dns.asyncResolve( - "httpssvc_esni.example.com", - dns.RESOLVE_TYPE_HTTPSSVC, - 0, - null, // resolverInfo - listenerEsni, - mainThread, - defaultOriginAttributes - ); - - let [inRequest, inRecord, inStatus] = await listenerEsni; - Assert.equal(inRequest, request, "correct request was used"); - Assert.equal(inStatus, Cr.NS_OK, "status OK"); - let answer = inRecord.QueryInterface(Ci.nsIDNSHTTPSSVCRecord).records; - let esni = answer[0].values[0].QueryInterface(Ci.nsISVCParamEchConfig); - Assert.equal(esni.echconfig, "testytestystringstring", "got correct answer"); -}); diff --git a/netwerk/test/unit_ipc/child_dns_by_type_resolve.js b/netwerk/test/unit_ipc/child_dns_by_type_resolve.js index 70785f3d1627..a6d76b573b61 100644 --- a/netwerk/test/unit_ipc/child_dns_by_type_resolve.js +++ b/netwerk/test/unit_ipc/child_dns_by_type_resolve.js @@ -53,24 +53,3 @@ add_task(async function testTXTResolve() { .getRecordsAsOneString(); Assert.equal(answer, test_answer, "got correct answer"); }); - -add_task(async function testHTTPSSVCResolve() { - // use the h2 server as DOH provider - let listenerEsni = new DNSListener(); - let request = dns.asyncResolve( - "httpssvc_esni.example.com", - dns.RESOLVE_TYPE_HTTPSSVC, - 0, - null, // resolverInfo - listenerEsni, - mainThread, - defaultOriginAttributes - ); - - let [inRequest, inRecord, inStatus] = await listenerEsni; - Assert.equal(inRequest, request, "correct request was used"); - Assert.equal(inStatus, Cr.NS_OK, "status OK"); - let answer = inRecord.QueryInterface(Ci.nsIDNSHTTPSSVCRecord).records; - let esni = answer[0].values[0].QueryInterface(Ci.nsISVCParamEchConfig); - Assert.equal(esni.echconfig, "testytestystringstring", "got correct answer"); -}); diff --git a/testing/xpcshell/moz-http2/moz-http2.js b/testing/xpcshell/moz-http2/moz-http2.js index be1340578326..c3327cdf2c80 100644 --- a/testing/xpcshell/moz-http2/moz-http2.js +++ b/testing/xpcshell/moz-http2/moz-http2.js @@ -735,19 +735,6 @@ function handleRequest(req, res) { "hex" ), }); - } else if (packet.questions[0].type == "HTTPS") { - answers.push({ - name: packet.questions[0].name, - type: packet.questions[0].type, - ttl: 55, - class: "IN", - flush: false, - data: { - priority: 1, - name: "some.domain.stuff.", - values: [{ key: "echconfig", value: "testytestystringstring" }], - }, - }); } if (u.query.cnameloop) {