1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 var { setTimeout
} = ChromeUtils
.importESModule(
8 "resource://gre/modules/Timer.sys.mjs"
15 const { TestUtils
} = ChromeUtils
.importESModule(
16 "resource://testing-common/TestUtils.sys.mjs"
18 const certOverrideService
= Cc
[
19 "@mozilla.org/security/certoverride;1"
20 ].getService(Ci
.nsICertOverrideService
);
22 add_setup(async
function setup() {
23 h2Port
= Services
.env
.get("MOZHTTP2_PORT");
24 Assert
.notEqual(h2Port
, null);
25 Assert
.notEqual(h2Port
, "");
27 h3Port
= Services
.env
.get("MOZHTTP3_PORT_NO_RESPONSE");
28 Assert
.notEqual(h3Port
, null);
29 Assert
.notEqual(h3Port
, "");
33 if (mozinfo
.socketprocess_networking
) {
34 Services
.dns
; // Needed to trigger socket process.
35 await TestUtils
.waitForCondition(() => Services
.io
.socketProcessLaunched
);
38 Services
.prefs
.setIntPref("network.trr.mode", 2); // TRR first
39 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
40 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 6);
41 Services
.prefs
.setBoolPref(
42 "network.dns.https_rr.check_record_with_cname",
46 registerCleanupFunction(async () => {
48 Services
.prefs
.clearUserPref("network.dns.upgrade_with_https_rr");
49 Services
.prefs
.clearUserPref("network.dns.use_https_rr_as_altsvc");
50 Services
.prefs
.clearUserPref("network.dns.echconfig.enabled");
51 Services
.prefs
.clearUserPref("network.dns.http3_echconfig.enabled");
52 Services
.prefs
.clearUserPref(
53 "network.dns.echconfig.fallback_to_origin_when_all_failed"
55 Services
.prefs
.clearUserPref("network.dns.httpssvc.reset_exclustion_list");
56 Services
.prefs
.clearUserPref("network.http.http3.enable");
57 Services
.prefs
.clearUserPref(
58 "network.dns.httpssvc.http3_fast_fallback_timeout"
60 Services
.prefs
.clearUserPref(
61 "network.http.http3.alt-svc-mapping-for-testing"
63 Services
.prefs
.clearUserPref("network.http.http3.backup_timer_delay");
64 Services
.prefs
.clearUserPref("network.http.speculative-parallel-limit");
65 Services
.prefs
.clearUserPref(
66 "network.http.http3.parallel_fallback_conn_limit"
68 Services
.prefs
.clearUserPref(
69 "network.dns.https_rr.check_record_with_cname"
72 await trrServer
.stop();
77 function makeChan(url
) {
78 let chan
= NetUtil
.newChannel({
80 loadUsingSystemPrincipal
: true,
81 contentPolicyType
: Ci
.nsIContentPolicy
.TYPE_DOCUMENT
,
82 }).QueryInterface(Ci
.nsIHttpChannel
);
83 chan
.loadFlags
= Ci
.nsIChannel
.LOAD_INITIAL_DOCUMENT_URI
;
87 function channelOpenPromise(chan
, flags
, delay
) {
88 // eslint-disable-next-line no-async-promise-executor
89 return new Promise(async resolve
=> {
90 function finish(req
, buffer
) {
91 resolve([req
, buffer
]);
92 certOverrideService
.setDisableAllSecurityChecksAndLetAttackersInterceptMyData(
96 certOverrideService
.setDisableAllSecurityChecksAndLetAttackersInterceptMyData(
100 // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
101 await
new Promise(r
=> setTimeout(r
, delay
));
103 chan
.asyncOpen(new ChannelListener(finish
, null, flags
));
107 let CheckOnlyHttp2Listener = function () {};
109 CheckOnlyHttp2Listener
.prototype = {
110 onStartRequest
: function testOnStartRequest() {},
112 onDataAvailable
: function testOnDataAvailable(request
, stream
, off
, cnt
) {
113 read_stream(stream
, cnt
);
116 onStopRequest
: function testOnStopRequest(request
, status
) {
117 Assert
.equal(status
, Cr
.NS_OK
);
118 let httpVersion
= "";
120 httpVersion
= request
.protocolVersion
;
122 Assert
.equal(httpVersion
, "h2");
126 routed
= request
.getRequestHeader("Alt-Used");
128 dump("routed is " + routed
+ "\n");
129 Assert
.ok(routed
=== "0" || routed
=== "NA");
134 async
function fast_fallback_test() {
136 // We need to loop here because we need to wait for AltSvc storage to
138 // We also do not have a way to verify that HTTP3 has been tried, because
139 // the fallback is automatic, so try a couple of times.
141 // We need to close HTTP2 connections, otherwise our connection pooling
142 // will dispatch the request over already existing HTTP2 connection.
143 Services
.obs
.notifyObservers(null, "net:prune-all-connections");
144 let chan
= makeChan(`https://foo.example.com:${h2Port}/`);
145 let listener
= new CheckOnlyHttp2Listener();
146 await
altsvcSetupPromise(chan
, listener
);
148 } while (result
< 3);
151 // Test the case when speculative connection is enabled. In this case, when the
152 // backup connection is ready, the http transaction is still in pending
153 // queue because the h3 connection is never ready to accept transactions.
154 add_task(async
function test_fast_fallback_with_speculative_connection() {
155 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
156 Services
.prefs
.setCharPref("network.dns.localDomains", "foo.example.com");
157 // Set AltSvc to point to not existing HTTP3 server on port 443
158 Services
.prefs
.setCharPref(
159 "network.http.http3.alt-svc-mapping-for-testing",
160 "foo.example.com;h3=:" + h3Port
162 Services
.prefs
.setBoolPref("network.dns.disableIPv6", true);
163 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 6);
165 await
fast_fallback_test();
168 // Test the case when speculative connection is disabled. In this case, when the
169 // back connection is ready, the http transaction is already activated,
170 // but the socket is not ready to write.
171 add_task(async
function test_fast_fallback_without_speculative_connection() {
172 // Make sure the h3 connection created by the previous test is cleared.
173 Services
.obs
.notifyObservers(null, "net:cancel-all-connections");
174 // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
175 await
new Promise(resolve
=> setTimeout(resolve
, 1000));
176 // Clear the h3 excluded list, otherwise the Alt-Svc mapping will not be used.
177 Services
.obs
.notifyObservers(null, "network:reset-http3-excluded-list");
178 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 0);
180 await
fast_fallback_test();
182 Services
.prefs
.clearUserPref(
183 "network.http.http3.alt-svc-mapping-for-testing"
187 // Test when echConfig is disabled and we have https rr for http3. We use a
188 // longer timeout in this test, so when fast fallback timer is triggered, the
189 // http transaction is already activated.
190 add_task(async
function testFastfallback() {
191 trrServer
= new TRRServer();
192 await trrServer
.start();
193 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
194 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
195 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", false);
197 Services
.prefs
.setIntPref("network.trr.mode", 3);
198 Services
.prefs
.setCharPref(
200 `https://foo.example.com:${trrServer.port()}/dns-query`
202 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
204 Services
.prefs
.setIntPref(
205 "network.dns.httpssvc.http3_fast_fallback_timeout",
209 await trrServer
.registerDoHAnswers("test.fastfallback.com", "HTTPS", {
212 name
: "test.fastfallback.com",
218 name
: "test.fastfallback1.com",
220 { key
: "alpn", value
: "h3" },
221 { key
: "no-default-alpn" },
222 { key
: "port", value
: h3Port
},
223 { key
: "echconfig", value
: "456..." },
228 name
: "test.fastfallback.com",
234 name
: "test.fastfallback2.com",
236 { key
: "alpn", value
: "h2" },
237 { key
: "port", value
: h2Port
},
238 { key
: "echconfig", value
: "456..." },
245 await trrServer
.registerDoHAnswers("test.fastfallback1.com", "A", {
248 name
: "test.fastfallback1.com",
257 await trrServer
.registerDoHAnswers("test.fastfallback2.com", "A", {
260 name
: "test.fastfallback2.com",
269 let chan
= makeChan(`https://test.fastfallback.com/server-timing`);
270 let [req
] = await
channelOpenPromise(chan
);
271 Assert
.equal(req
.protocolVersion
, "h2");
272 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
273 Assert
.equal(internal.remotePort
, h2Port
);
275 await trrServer
.stop();
278 // Like the previous test, but with a shorter timeout, so when fast fallback
279 // timer is triggered, the http transaction is still in pending queue.
280 add_task(async
function testFastfallback1() {
281 trrServer
= new TRRServer();
282 await trrServer
.start();
283 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
284 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
285 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", false);
287 Services
.prefs
.setIntPref("network.trr.mode", 3);
288 Services
.prefs
.setCharPref(
290 `https://foo.example.com:${trrServer.port()}/dns-query`
292 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
294 Services
.prefs
.setIntPref(
295 "network.dns.httpssvc.http3_fast_fallback_timeout",
299 await trrServer
.registerDoHAnswers("test.fastfallback.org", "HTTPS", {
302 name
: "test.fastfallback.org",
308 name
: "test.fastfallback1.org",
310 { key
: "alpn", value
: "h3" },
311 { key
: "no-default-alpn" },
312 { key
: "port", value
: h3Port
},
313 { key
: "echconfig", value
: "456..." },
318 name
: "test.fastfallback.org",
324 name
: "test.fastfallback2.org",
326 { key
: "alpn", value
: "h2" },
327 { key
: "port", value
: h2Port
},
328 { key
: "echconfig", value
: "456..." },
335 await trrServer
.registerDoHAnswers("test.fastfallback1.org", "A", {
338 name
: "test.fastfallback1.org",
347 await trrServer
.registerDoHAnswers("test.fastfallback2.org", "A", {
350 name
: "test.fastfallback2.org",
359 let chan
= makeChan(`https://test.fastfallback.org/server-timing`);
360 let [req
] = await
channelOpenPromise(chan
);
361 Assert
.equal(req
.protocolVersion
, "h2");
362 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
363 Assert
.equal(internal.remotePort
, h2Port
);
365 await trrServer
.stop();
368 // Test when echConfig is enabled, we can sucessfully fallback to the last
370 add_task(async
function testFastfallbackWithEchConfig() {
371 trrServer
= new TRRServer();
372 await trrServer
.start();
373 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
374 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
375 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", true);
376 Services
.prefs
.setBoolPref("network.dns.http3_echconfig.enabled", true);
378 Services
.prefs
.setIntPref("network.trr.mode", 3);
379 Services
.prefs
.setCharPref(
381 `https://foo.example.com:${trrServer.port()}/dns-query`
383 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
385 Services
.prefs
.setIntPref(
386 "network.dns.httpssvc.http3_fast_fallback_timeout",
390 await trrServer
.registerDoHAnswers("test.ech.org", "HTTPS", {
393 name
: "test.ech.org",
399 name
: "test.ech1.org",
401 { key
: "alpn", value
: "h3" },
402 { key
: "port", value
: h3Port
},
403 { key
: "echconfig", value
: "456..." },
408 name
: "test.ech.org",
414 name
: "test.ech2.org",
416 { key
: "alpn", value
: "h2" },
417 { key
: "port", value
: h2Port
},
418 { key
: "echconfig", value
: "456..." },
423 name
: "test.ech.org",
429 name
: "test.ech3.org",
431 { key
: "alpn", value
: "h2" },
432 { key
: "port", value
: h2Port
},
433 { key
: "echconfig", value
: "456..." },
440 await trrServer
.registerDoHAnswers("test.ech1.org", "A", {
443 name
: "test.ech1.org",
452 await trrServer
.registerDoHAnswers("test.ech3.org", "A", {
455 name
: "test.ech3.org",
464 let chan
= makeChan(`https://test.ech.org/server-timing`);
465 let [req
] = await
channelOpenPromise(chan
);
466 Assert
.equal(req
.protocolVersion
, "h2");
467 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
468 Assert
.equal(internal.remotePort
, h2Port
);
470 await trrServer
.stop();
473 // Test when echConfig is enabled, the connection should fail when not all
474 // records have echConfig.
475 add_task(async
function testFastfallbackWithpartialEchConfig() {
476 trrServer
= new TRRServer();
477 await trrServer
.start();
478 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
479 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
480 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", true);
481 Services
.prefs
.setBoolPref("network.dns.http3_echconfig.enabled", true);
483 Services
.prefs
.setIntPref("network.trr.mode", 3);
484 Services
.prefs
.setCharPref(
486 `https://foo.example.com:${trrServer.port()}/dns-query`
488 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
490 Services
.prefs
.setIntPref(
491 "network.dns.httpssvc.http3_fast_fallback_timeout",
495 await trrServer
.registerDoHAnswers("test.partial_ech.org", "HTTPS", {
498 name
: "test.partial_ech.org",
504 name
: "test.partial_ech1.org",
506 { key
: "alpn", value
: "h3" },
507 { key
: "port", value
: h3Port
},
508 { key
: "echconfig", value
: "456..." },
513 name
: "test.partial_ech.org",
519 name
: "test.partial_ech2.org",
521 { key
: "alpn", value
: "h2" },
522 { key
: "port", value
: h2Port
},
529 await trrServer
.registerDoHAnswers("test.partial_ech1.org", "A", {
532 name
: "test.partial_ech1.org",
541 await trrServer
.registerDoHAnswers("test.partial_ech2.org", "A", {
544 name
: "test.partial_ech2.org",
553 let chan
= makeChan(`https://test.partial_ech.org/server-timing`);
554 await
channelOpenPromise(chan
, CL_EXPECT_LATE_FAILURE
| CL_ALLOW_UNKNOWN_CL
);
556 await trrServer
.stop();
559 add_task(async
function testFastfallbackWithoutEchConfig() {
560 trrServer
= new TRRServer();
561 await trrServer
.start();
562 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
563 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
565 Services
.prefs
.setIntPref("network.trr.mode", 3);
566 Services
.prefs
.setCharPref(
568 `https://foo.example.com:${trrServer.port()}/dns-query`
570 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
572 Services
.prefs
.setIntPref(
573 "network.dns.httpssvc.http3_fast_fallback_timeout",
577 await trrServer
.registerDoHAnswers("test.no_ech_h2.org", "HTTPS", {
580 name
: "test.no_ech_h2.org",
586 name
: "test.no_ech_h3.org",
588 { key
: "alpn", value
: "h3" },
589 { key
: "port", value
: h3Port
},
596 await trrServer
.registerDoHAnswers("test.no_ech_h3.org", "A", {
599 name
: "test.no_ech_h3.org",
608 await trrServer
.registerDoHAnswers("test.no_ech_h2.org", "A", {
611 name
: "test.no_ech_h2.org",
620 let chan
= makeChan(`https://test.no_ech_h2.org:${h2Port}/server-timing`);
621 let [req
] = await
channelOpenPromise(chan
);
622 Assert
.equal(req
.protocolVersion
, "h2");
623 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
624 Assert
.equal(internal.remotePort
, h2Port
);
626 await trrServer
.stop();
629 add_task(async
function testH3FallbackWithMultipleTransactions() {
630 trrServer
= new TRRServer();
631 await trrServer
.start();
632 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
633 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
634 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", false);
636 Services
.prefs
.setIntPref("network.trr.mode", 3);
637 Services
.prefs
.setCharPref(
639 `https://foo.example.com:${trrServer.port()}/dns-query`
641 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
643 // Disable fast fallback.
644 Services
.prefs
.setIntPref(
645 "network.http.http3.parallel_fallback_conn_limit",
648 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 0);
650 await trrServer
.registerDoHAnswers("test.multiple_trans.org", "HTTPS", {
653 name
: "test.multiple_trans.org",
659 name
: "test.multiple_trans.org",
661 { key
: "alpn", value
: "h3" },
662 { key
: "port", value
: h3Port
},
669 await trrServer
.registerDoHAnswers("test.multiple_trans.org", "A", {
672 name
: "test.multiple_trans.org",
682 for (let i
= 0; i
< 2; ++i
) {
684 `https://test.multiple_trans.org:${h2Port}/server-timing`
686 promises
.push(channelOpenPromise(chan
));
689 let res
= await Promise
.all(promises
);
690 res
.forEach(function (e
) {
692 Assert
.equal(req
.protocolVersion
, "h2");
693 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
694 Assert
.equal(internal.remotePort
, h2Port
);
697 await trrServer
.stop();
700 add_task(async
function testTwoFastFallbackTimers() {
701 trrServer
= new TRRServer();
702 await trrServer
.start();
703 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
704 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
705 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", false);
707 Services
.prefs
.setIntPref("network.trr.mode", 3);
708 Services
.prefs
.setCharPref(
710 `https://foo.example.com:${trrServer.port()}/dns-query`
712 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
714 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 6);
715 Services
.prefs
.clearUserPref(
716 "network.http.http3.parallel_fallback_conn_limit"
719 Services
.prefs
.setCharPref(
720 "network.http.http3.alt-svc-mapping-for-testing",
721 "foo.fallback.org;h3=:" + h3Port
724 Services
.prefs
.setIntPref(
725 "network.dns.httpssvc.http3_fast_fallback_timeout",
728 Services
.prefs
.setIntPref("network.http.http3.backup_timer_delay", 100);
730 await trrServer
.registerDoHAnswers("foo.fallback.org", "HTTPS", {
733 name
: "foo.fallback.org",
739 name
: "foo.fallback.org",
741 { key
: "alpn", value
: "h3" },
742 { key
: "port", value
: h3Port
},
749 await trrServer
.registerDoHAnswers("foo.fallback.org", "A", {
752 name
: "foo.fallback.org",
761 // Test the case that http3 backup timer is triggered after
762 // fast fallback timer or HTTPS RR.
763 Services
.prefs
.setIntPref(
764 "network.dns.httpssvc.http3_fast_fallback_timeout",
767 Services
.prefs
.setIntPref("network.http.http3.backup_timer_delay", 100);
769 async
function createChannelAndStartTest() {
770 let chan
= makeChan(`https://foo.fallback.org:${h2Port}/server-timing`);
771 let [req
] = await
channelOpenPromise(chan
);
772 Assert
.equal(req
.protocolVersion
, "h2");
773 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
774 Assert
.equal(internal.remotePort
, h2Port
);
777 await
createChannelAndStartTest();
779 Services
.obs
.notifyObservers(null, "net:prune-all-connections");
780 Services
.obs
.notifyObservers(null, "network:reset-http3-excluded-list");
781 Services
.dns
.clearCache(true);
783 // Do the same test again, but with a different configuration.
784 Services
.prefs
.setIntPref(
785 "network.dns.httpssvc.http3_fast_fallback_timeout",
788 Services
.prefs
.setIntPref("network.http.http3.backup_timer_delay", 10);
790 await
createChannelAndStartTest();
792 await trrServer
.stop();
795 add_task(async
function testH3FastFallbackWithMultipleTransactions() {
796 trrServer
= new TRRServer();
797 await trrServer
.start();
798 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
799 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
800 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", false);
802 Services
.prefs
.setIntPref("network.trr.mode", 3);
803 Services
.prefs
.setCharPref(
805 `https://foo.example.com:${trrServer.port()}/dns-query`
807 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
809 Services
.prefs
.setIntPref("network.http.speculative-parallel-limit", 6);
810 Services
.prefs
.clearUserPref(
811 "network.http.http3.parallel_fallback_conn_limit"
814 Services
.prefs
.setIntPref("network.http.http3.backup_timer_delay", 500);
816 Services
.prefs
.setCharPref(
817 "network.http.http3.alt-svc-mapping-for-testing",
818 "test.multiple_fallback_trans.org;h3=:" + h3Port
821 await trrServer
.registerDoHAnswers("test.multiple_fallback_trans.org", "A", {
824 name
: "test.multiple_fallback_trans.org",
834 for (let i
= 0; i
< 3; ++i
) {
836 `https://test.multiple_fallback_trans.org:${h2Port}/server-timing`
839 promises
.push(channelOpenPromise(chan
));
841 promises
.push(channelOpenPromise(chan
, null, 500));
845 let res
= await Promise
.all(promises
);
846 res
.forEach(function (e
) {
848 Assert
.equal(req
.protocolVersion
, "h2");
849 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
850 Assert
.equal(internal.remotePort
, h2Port
);
853 await trrServer
.stop();
856 add_task(async
function testFastfallbackToTheSameRecord() {
857 trrServer
= new TRRServer();
858 await trrServer
.start();
859 Services
.prefs
.setBoolPref("network.dns.upgrade_with_https_rr", true);
860 Services
.prefs
.setBoolPref("network.dns.use_https_rr_as_altsvc", true);
861 Services
.prefs
.setBoolPref("network.dns.echconfig.enabled", true);
862 Services
.prefs
.setBoolPref("network.dns.http3_echconfig.enabled", true);
864 Services
.prefs
.setIntPref("network.trr.mode", 3);
865 Services
.prefs
.setCharPref(
867 `https://foo.example.com:${trrServer.port()}/dns-query`
869 Services
.prefs
.setBoolPref("network.http.http3.enable", true);
871 Services
.prefs
.setIntPref(
872 "network.dns.httpssvc.http3_fast_fallback_timeout",
876 await trrServer
.registerDoHAnswers("test.ech.org", "HTTPS", {
879 name
: "test.ech.org",
885 name
: "test.ech1.org",
887 { key
: "alpn", value
: ["h3", "h2"] },
888 { key
: "port", value
: h2Port
},
889 { key
: "echconfig", value
: "456..." },
896 await trrServer
.registerDoHAnswers("test.ech1.org", "A", {
899 name
: "test.ech1.org",
908 let chan
= makeChan(`https://test.ech.org/server-timing`);
909 let [req
] = await
channelOpenPromise(chan
);
910 Assert
.equal(req
.protocolVersion
, "h2");
911 let internal = req
.QueryInterface(Ci
.nsIHttpChannelInternal
);
912 Assert
.equal(internal.remotePort
, h2Port
);
914 await trrServer
.stop();