Skip to content

Commit 321c452

Browse files
authored
Define interaction with DNS HTTPS resource record
This also makes everything go through "resolve an origin" and removes "resolve a domain" as we need the scheme sometimes. Closes #1315.
1 parent 583986a commit 321c452

File tree

1 file changed

+43
-27
lines changed

1 file changed

+43
-27
lines changed

fetch.bs

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ spec:websockets; type:attribute; text:bufferedAmount; for:WebSocket
116116
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-masque-h3-datagram",
117117
"publisher": "IETF",
118118
"title": "Using QUIC Datagrams with HTTP/3"
119+
},
120+
"SVCB": {
121+
"authors": ["Ben Schwartz", "Mike Bishop", "Erik Nygren"],
122+
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https",
123+
"publisher": "IETF",
124+
"title": "Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)"
119125
}
120126
}
121127
</pre>
@@ -2343,51 +2349,50 @@ functionality.
23432349

23442350
<h3 id=resolving-domains>Resolving domains</h3>
23452351

2346-
<p tracking-vector>To <dfn>resolve a domain</dfn>, given a <a for=/>network partition key</a>
2347-
<var>key</var> and a <a for=/>domain</a> <var>domain</var>:
2352+
<p tracking-vector>To
2353+
<dfn export id=resolve-an-origin oldids=resolve-a-domain>resolve an origin</dfn>, given a
2354+
<a for=/>network partition key</a> <var>key</var> and an <a for=/>origin</a> <var>origin</var>:
2355+
<!-- Should we assert the scheme here to be an HTTP(S) scheme or a WebRTC scheme? -->
23482356

23492357
<ol>
2350-
<li><p>If <var>domain</var> is a <a for=/>host</a> whose <a for=host>public suffix</a> is
2358+
<li><p>If <var>origin</var>'s <a for=origin>host</a> is an <a for=/>IP address</a>, then return
2359+
« <var>origin</var>'s <a for=origin>host</a> ».
2360+
2361+
<li><p>If <var>origin</var>'s <a for=origin>host</a>'s <a for=host>public suffix</a> is
23512362
"<code>localhost</code>", then return « <code>::1</code>, <code>127.0.0.1</code> ».
23522363

2353-
<li><p>Perform an <a>implementation-defined</a> operation to turn <var>domain</var> into a
2354-
<a for=/>set</a> of one or more <a for=/>IP addresses</a>. If this operation succeeds, return the
2355-
<a for=/>set</a> of <a for=/>IP addresses</a>.
2364+
<li>
2365+
<p>Perform an <a>implementation-defined</a> operation to turn <var>origin</var> into a
2366+
<a for=/>set</a> of one or more <a for=/>IP addresses</a>.
2367+
2368+
<p>It is also <a>implementation-defined</a> whether other operations might be performed to get
2369+
connection information beyond just <a for=/>IP addresses</a>. For example, if <var>origin</var>'s
2370+
<a for=origin>scheme</a> is an <a>HTTP(S) scheme</a>, the implementation might perform a DNS query
2371+
for HTTPS RRs. [[SVCB]]
2372+
2373+
<p>If this operation succeeds, return the <a for=/>set</a> of <a for=/>IP addresses</a> and any
2374+
additional <a>implementation-defined</a> information.
2375+
</li>
23562376

23572377
<li><p>Return failure.
23582378
</ol>
23592379

2360-
<p>The results of <a>resolve a domain</a> may be cached. If they are cached, <var>key</var> should
2380+
<p>The results of <a>resolve an origin</a> may be cached. If they are cached, <var>key</var> should
23612381
be used as part of the cache key.
23622382

23632383
<div class=note>
23642384
<p>Typically this operation would involve DNS and as such caching can happen on DNS servers without
23652385
<var>key</var> being taken into account. Depending on the implementation it might also not be
23662386
possible to take <var>key</var> into account locally. [[RFC1035]]
23672387

2368-
<p>The order of the <a for=/>IP addresses</a> <a>resolve a domain</a> can return return can differ
2369-
between invocations.
2388+
<p>The order of the <a for=/>IP addresses</a> that the <a>resolve an origin</a> algorithm can return
2389+
can differ between invocations.
23702390

23712391
<p>The particulars (apart from the cache key) are not tied down as they are not pertinent to the
23722392
system the Fetch Standard establishes. Other documents ought not to build on this primitive without
23732393
having a considered discussion with the Fetch Standard community first.
23742394
</div>
23752395

2376-
<p>To <dfn>resolve an origin</dfn>, given a <a for=/>network partition key</a> <var>key</var> and an
2377-
<a for=/>origin</a> <var>origin</var>:
2378-
<!-- Should we assert the scheme here to be an HTTP(S) scheme or a WebRTC scheme? -->
2379-
2380-
<ol>
2381-
<li><p>If <var>origin</var>'s <a for=origin>host</a> is an <a for=/>IP address</a>, then return
2382-
« <var>origin</var>'s <a for=origin>host</a> ».
2383-
2384-
<li><p>Return the result of running <a>resolve a domain</a> given <var>key</var> and
2385-
<var>origin</var>'s <a for=origin>host</a>.
2386-
</ol>
2387-
2388-
<p class=note>The same caveat applies. Do not build on this without having a considered discussion
2389-
with the Fetch Standard community first.
2390-
23912396

23922397
<h3 id=connections>Connections</h3>
23932398

@@ -2525,7 +2530,7 @@ steps:
25252530
return it. Any other returned values that are <a>connections</a> may be closed.
25262531

25272532
<p class=note>Essentially this allows an implementation to pick one or more
2528-
<a for=/>IP addresses</a> from the return value of <a>resolve a domain</a> (assuming
2533+
<a for=/>IP addresses</a> from the return value of <a>resolve an origin</a> (assuming
25292534
<var>proxy</var> is "<code>DIRECT</code>") and race them against each other, favor
25302535
<a for=/>IPv6 addresses</a>, retry in case of a timeout, etc.
25312536

@@ -4049,11 +4054,21 @@ steps:
40494054
<li>Matching <var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a> per
40504055
<a href=https://datatracker.ietf.org/doc/html/rfc6797#section-8.2>Known HSTS Host Domain Name Matching</a>
40514056
results in either a superdomain match with an asserted <code>includeSubDomains</code> directive
4052-
or a congruent match (with or without an asserted <code>includeSubDomains</code> directive).
4053-
[[!HSTS]]
4057+
or a congruent match (with or without an asserted <code>includeSubDomains</code> directive) [[!HSTS]]; or
4058+
DNS resolution for the request finds a matching HTTPS RR per
4059+
<a href=https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https#section-9.5>section 9.5</a>
4060+
of [[!SVCB]].
4061+
[[!HSTS]][[!SVCB]]
40544062
</ul>
40554063
<!-- Per Mike West HSTS happens "probably after" Referrer -->
40564064

4065+
<p class=note>As all DNS operations are generally <a>implementation-defined</a>, how it is
4066+
determined that DNS resolution contains an HTTPS RR is also <a>implementation-defined</a>. As DNS
4067+
operations are not traditionally performed until attempting to <a>obtain a connection</a>, user
4068+
agents might need to perform DNS operations earlier, consult local DNS caches, or wait until later
4069+
in the fetch algorithm and potentially unwind logic on discovering the need to change
4070+
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>scheme</a>.
4071+
40574072
<li><p>If <var>recursive</var> is false, then run the remaining steps <a>in parallel</a>.
40584073

40594074
<li>
@@ -8240,6 +8255,7 @@ Eero Häkkinen,
82408255
Ehsan Akhgari,
82418256
Emily Stark,
82428257
Eric Lawrence,
8258+
Eric Orth,
82438259
François Marier,
82448260
Frank Ellerman,
82458261
Frederick Hirsch,

0 commit comments

Comments
 (0)