diff options
Diffstat (limited to 'doc/rfc6120.html')
-rw-r--r-- | doc/rfc6120.html | 9372 |
1 files changed, 9372 insertions, 0 deletions
diff --git a/doc/rfc6120.html b/doc/rfc6120.html new file mode 100644 index 00000000..fa7ef081 --- /dev/null +++ b/doc/rfc6120.html | |||
@@ -0,0 +1,9372 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
2 | <html lang="en"><head><title>Extensible Messaging and Presence Protocol (XMPP): Core</title> | ||
3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
4 | <meta name="description" content="Extensible Messaging and Presence Protocol (XMPP): Core"> | ||
5 | <meta name="keywords" content="XMPP, Extensible Messaging and Presence Protocol, Jabber, Messaging, Instant Messaging, Presence, Extensible Markup Language, XML"> | ||
6 | <meta name="generator" content="xml2rfc v1.36 (http://xml.resource.org/)"> | ||
7 | <style type='text/css'><!-- | ||
8 | body { | ||
9 | font-family: verdana, charcoal, helvetica, arial, sans-serif; | ||
10 | font-size: small; color: #000; background-color: #FFF; | ||
11 | margin: 2em; | ||
12 | } | ||
13 | h1, h2, h3, h4, h5, h6 { | ||
14 | font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif; | ||
15 | font-weight: bold; font-style: normal; | ||
16 | } | ||
17 | h1 { color: #900; background-color: transparent; text-align: right; } | ||
18 | h3 { color: #333; background-color: transparent; } | ||
19 | |||
20 | td.RFCbug { | ||
21 | font-size: x-small; text-decoration: none; | ||
22 | width: 30px; height: 30px; padding-top: 2px; | ||
23 | text-align: justify; vertical-align: middle; | ||
24 | background-color: #000; | ||
25 | } | ||
26 | td.RFCbug span.RFC { | ||
27 | font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif; | ||
28 | font-weight: bold; color: #666; | ||
29 | } | ||
30 | td.RFCbug span.hotText { | ||
31 | font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif; | ||
32 | font-weight: normal; text-align: center; color: #FFF; | ||
33 | } | ||
34 | |||
35 | table.TOCbug { width: 30px; height: 15px; } | ||
36 | td.TOCbug { | ||
37 | text-align: center; width: 30px; height: 15px; | ||
38 | color: #FFF; background-color: #900; | ||
39 | } | ||
40 | td.TOCbug a { | ||
41 | font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif; | ||
42 | font-weight: bold; font-size: x-small; text-decoration: none; | ||
43 | color: #FFF; background-color: transparent; | ||
44 | } | ||
45 | |||
46 | td.header { | ||
47 | font-family: arial, helvetica, sans-serif; font-size: x-small; | ||
48 | vertical-align: top; width: 33%; | ||
49 | color: #FFF; background-color: #666; | ||
50 | } | ||
51 | td.author { font-weight: bold; font-size: x-small; margin-left: 4em; } | ||
52 | td.author-text { font-size: x-small; } | ||
53 | |||
54 | /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */ | ||
55 | a.info { | ||
56 | /* This is the key. */ | ||
57 | position: relative; | ||
58 | z-index: 24; | ||
59 | text-decoration: none; | ||
60 | } | ||
61 | a.info:hover { | ||
62 | z-index: 25; | ||
63 | color: #FFF; background-color: #900; | ||
64 | } | ||
65 | a.info span { display: none; } | ||
66 | a.info:hover span.info { | ||
67 | /* The span will display just on :hover state. */ | ||
68 | display: block; | ||
69 | position: absolute; | ||
70 | font-size: smaller; | ||
71 | top: 2em; left: -5em; width: 15em; | ||
72 | padding: 2px; border: 1px solid #333; | ||
73 | color: #900; background-color: #EEE; | ||
74 | text-align: left; | ||
75 | } | ||
76 | |||
77 | a { font-weight: bold; } | ||
78 | a:link { color: #900; background-color: transparent; } | ||
79 | a:visited { color: #633; background-color: transparent; } | ||
80 | a:active { color: #633; background-color: transparent; } | ||
81 | |||
82 | p { margin-left: 2em; margin-right: 2em; } | ||
83 | p.copyright { font-size: x-small; } | ||
84 | p.toc { font-size: small; font-weight: bold; margin-left: 3em; } | ||
85 | table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; } | ||
86 | td.toc { font-size: small; font-weight: bold; vertical-align: text-top; } | ||
87 | |||
88 | ol.text { margin-left: 2em; margin-right: 2em; } | ||
89 | ul.text { margin-left: 2em; margin-right: 2em; } | ||
90 | li { margin-left: 3em; } | ||
91 | |||
92 | /* RFC-2629 <spanx>s and <artwork>s. */ | ||
93 | em { font-style: italic; } | ||
94 | strong { font-weight: bold; } | ||
95 | dfn { font-weight: bold; font-style: normal; } | ||
96 | cite { font-weight: normal; font-style: normal; } | ||
97 | tt { color: #036; } | ||
98 | tt, pre, pre dfn, pre em, pre cite, pre span { | ||
99 | font-family: "Courier New", Courier, monospace; font-size: small; | ||
100 | } | ||
101 | pre { | ||
102 | text-align: left; padding: 4px; | ||
103 | color: #000; background-color: #CCC; | ||
104 | } | ||
105 | pre dfn { color: #900; } | ||
106 | pre em { color: #66F; background-color: #FFC; font-weight: normal; } | ||
107 | pre .key { color: #33C; font-weight: bold; } | ||
108 | pre .id { color: #900; } | ||
109 | pre .str { color: #000; background-color: #CFF; } | ||
110 | pre .val { color: #066; } | ||
111 | pre .rep { color: #909; } | ||
112 | pre .oth { color: #000; background-color: #FCF; } | ||
113 | pre .err { background-color: #FCC; } | ||
114 | |||
115 | /* RFC-2629 <texttable>s. */ | ||
116 | table.all, table.full, table.headers, table.none { | ||
117 | font-size: small; text-align: center; border-width: 2px; | ||
118 | vertical-align: top; border-collapse: collapse; | ||
119 | } | ||
120 | table.all, table.full { border-style: solid; border-color: black; } | ||
121 | table.headers, table.none { border-style: none; } | ||
122 | th { | ||
123 | font-weight: bold; border-color: black; | ||
124 | border-width: 2px 2px 3px 2px; | ||
125 | } | ||
126 | table.all th, table.full th { border-style: solid; } | ||
127 | table.headers th { border-style: none none solid none; } | ||
128 | table.none th { border-style: none; } | ||
129 | table.all td { | ||
130 | border-style: solid; border-color: #333; | ||
131 | border-width: 1px 2px; | ||
132 | } | ||
133 | table.full td, table.headers td, table.none td { border-style: none; } | ||
134 | |||
135 | hr { height: 1px; } | ||
136 | hr.insert { | ||
137 | width: 80%; border-style: none; border-width: 0; | ||
138 | color: #CCC; background-color: #CCC; | ||
139 | } | ||
140 | --></style> | ||
141 | </head> | ||
142 | <body> | ||
143 | |||
144 | <table border="0" cellpadding="0" cellspacing="2" width="30" align="right"> | ||
145 | <tr> | ||
146 | <td class="RFCbug"> | ||
147 | <span class="RFC"> RFC </span><br /><span class="hotText"> 6120 </span> | ||
148 | </td> | ||
149 | </tr> | ||
150 | <tr><td class="TOCbug"><a href="#toc"> TOC </a><br /></td></tr> | ||
151 | </table> | ||
152 | <table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1"> | ||
153 | <tr><td class="header">Internet Engineering Task Force (IETF)</td><td class="header">P. Saint-Andre</td></tr> | ||
154 | <tr><td class="header">Request for Comments: 6120</td><td class="header">Cisco</td></tr> | ||
155 | <tr><td class="header">Obsoletes: <a href='http://tools.ietf.org/html/rfc3920'>3920</a></td><td class="header">March 2011</td></tr> | ||
156 | <tr><td class="header">Category: Standards Track</td><td class="header"> </td></tr> | ||
157 | <tr><td class="header">ISSN: 2070-1721</td><td class="header"> </td></tr> | ||
158 | </table></td></tr></table> | ||
159 | <h1><br />Extensible Messaging and Presence Protocol (XMPP): Core</h1> | ||
160 | |||
161 | <h3>Abstract</h3> | ||
162 | |||
163 | <p>The Extensible Messaging and Presence Protocol (XMPP) is an application profile of the Extensible Markup Language (XML) that enables the near-real-time exchange of structured yet extensible data between any two or more network entities. This document defines XMPP's core protocol methods: setup and teardown of XML streams, channel encryption, authentication, error handling, and communication primitives for messaging, network availability ("presence"), and request-response interactions. This document obsoletes RFC 3920. | ||
164 | </p> | ||
165 | <h3>Status of This Memo</h3> | ||
166 | <p> | ||
167 | This is an Internet Standards Track document.</p> | ||
168 | <p> | ||
169 | This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.</p> | ||
170 | <p> | ||
171 | Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6120.</p> | ||
172 | |||
173 | <h3>Copyright Notice</h3> | ||
174 | <p> | ||
175 | Copyright (c) 2011 IETF Trust and the persons identified as the | ||
176 | document authors. All rights reserved.</p> | ||
177 | <p> | ||
178 | This document is subject to BCP 78 and the IETF Trust's Legal | ||
179 | Provisions Relating to IETF Documents | ||
180 | (http://trustee.ietf.org/license-info) in effect on the date of | ||
181 | publication of this document. Please review these documents | ||
182 | carefully, as they describe your rights and restrictions with respect | ||
183 | to this document. Code Components extracted from this document must | ||
184 | include Simplified BSD License text as described in Section 4.e of | ||
185 | the Trust Legal Provisions and are provided without warranty as | ||
186 | described in the Simplified BSD License.</p> | ||
187 | <a name="toc"></a><hr /> | ||
188 | |||
189 | <table border="0" cellpadding="0" cellspacing="2" width="30" align="right"> | ||
190 | <tr> | ||
191 | <td class="RFCbug"> | ||
192 | <span class="RFC"> RFC </span><br /><span class="hotText"> 6120 </span> | ||
193 | </td> | ||
194 | </tr> | ||
195 | <tr><td class="TOCbug"><a href="#toc"> TOC </a><br /></td></tr> | ||
196 | </table> | ||
197 | <h3>Table of Contents</h3> | ||
198 | <p class="toc"> | ||
199 | <a href="#intro">1.</a> | ||
200 | Introduction<br /> | ||
201 | <a href="#intro-overview">1.1.</a> | ||
202 | Overview<br /> | ||
203 | <a href="#intro-history">1.2.</a> | ||
204 | History<br /> | ||
205 | <a href="#intro-summary">1.3.</a> | ||
206 | Functional Summary<br /> | ||
207 | <a href="#intro-terms">1.4.</a> | ||
208 | Terminology<br /> | ||
209 | <a href="#arch">2.</a> | ||
210 | Architecture<br /> | ||
211 | <a href="#arch-addresses">2.1.</a> | ||
212 | Global Addresses<br /> | ||
213 | <a href="#arch-presence">2.2.</a> | ||
214 | Presence<br /> | ||
215 | <a href="#arch-streams">2.3.</a> | ||
216 | Persistent Streams<br /> | ||
217 | <a href="#arch-data">2.4.</a> | ||
218 | Structured Data<br /> | ||
219 | <a href="#arch-network">2.5.</a> | ||
220 | Distributed Network of Clients and Servers<br /> | ||
221 | <a href="#tcp">3.</a> | ||
222 | TCP Binding<br /> | ||
223 | <a href="#tcp-scope">3.1.</a> | ||
224 | Scope<br /> | ||
225 | <a href="#tcp-resolution">3.2.</a> | ||
226 | Resolution of Fully Qualified Domain Names<br /> | ||
227 | <a href="#tcp-resolution-prefer">3.2.1.</a> | ||
228 | Preferred Process: SRV Lookup<br /> | ||
229 | <a href="#tcp-resolution-fallback">3.2.2.</a> | ||
230 | Fallback Processes<br /> | ||
231 | <a href="#tcp-resolution-srvnot">3.2.3.</a> | ||
232 | When Not to Use SRV<br /> | ||
233 | <a href="#tcp-resolution-srvadd">3.2.4.</a> | ||
234 | Use of SRV Records with Add-On Services<br /> | ||
235 | <a href="#tcp-reconnect">3.3.</a> | ||
236 | Reconnection<br /> | ||
237 | <a href="#streams-reliability">3.4.</a> | ||
238 | Reliability<br /> | ||
239 | <a href="#streams">4.</a> | ||
240 | XML Streams<br /> | ||
241 | <a href="#streams-fundamentals">4.1.</a> | ||
242 | Stream Fundamentals<br /> | ||
243 | <a href="#streams-open">4.2.</a> | ||
244 | Opening a Stream<br /> | ||
245 | <a href="#streams-negotiation">4.3.</a> | ||
246 | Stream Negotiation<br /> | ||
247 | <a href="#streams-negotiation-basics">4.3.1.</a> | ||
248 | Basic Concepts<br /> | ||
249 | <a href="#streams-negotiation-features">4.3.2.</a> | ||
250 | Stream Features Format<br /> | ||
251 | <a href="#streams-negotiation-restart">4.3.3.</a> | ||
252 | Restarts<br /> | ||
253 | <a href="#streams-negotiation-resend">4.3.4.</a> | ||
254 | Resending Features<br /> | ||
255 | <a href="#streams-negotiation-complete">4.3.5.</a> | ||
256 | Completion of Stream Negotiation<br /> | ||
257 | <a href="#streams-negotiation-address">4.3.6.</a> | ||
258 | Determination of Addresses<br /> | ||
259 | <a href="#streams-negotiation-flowchart">4.3.7.</a> | ||
260 | Flow Chart<br /> | ||
261 | <a href="#streams-close">4.4.</a> | ||
262 | Closing a Stream<br /> | ||
263 | <a href="#streams-direction">4.5.</a> | ||
264 | Directionality<br /> | ||
265 | <a href="#streams-silence">4.6.</a> | ||
266 | Handling of Silent Peers<br /> | ||
267 | <a href="#streams-silence-dead">4.6.1.</a> | ||
268 | Dead Connection<br /> | ||
269 | <a href="#streams-silence-broken">4.6.2.</a> | ||
270 | Broken Stream<br /> | ||
271 | <a href="#streams-silence-idle">4.6.3.</a> | ||
272 | Idle Peer<br /> | ||
273 | <a href="#streams-silence-check">4.6.4.</a> | ||
274 | Use of Checking Methods<br /> | ||
275 | <a href="#streams-attr">4.7.</a> | ||
276 | Stream Attributes<br /> | ||
277 | <a href="#streams-attr-from">4.7.1.</a> | ||
278 | from<br /> | ||
279 | <a href="#streams-attr-to">4.7.2.</a> | ||
280 | to<br /> | ||
281 | <a href="#streams-attr-id">4.7.3.</a> | ||
282 | id<br /> | ||
283 | <a href="#streams-attr-xmllang">4.7.4.</a> | ||
284 | xml:lang<br /> | ||
285 | <a href="#streams-attr-version">4.7.5.</a> | ||
286 | version<br /> | ||
287 | <a href="#streams-attr-summary">4.7.6.</a> | ||
288 | Summary of Stream Attributes<br /> | ||
289 | <a href="#streams-ns">4.8.</a> | ||
290 | XML Namespaces<br /> | ||
291 | <a href="#streams-ns-stream">4.8.1.</a> | ||
292 | Stream Namespace<br /> | ||
293 | <a href="#streams-ns-content">4.8.2.</a> | ||
294 | Content Namespace<br /> | ||
295 | <a href="#streams-ns-xmpp">4.8.3.</a> | ||
296 | XMPP Content Namespaces<br /> | ||
297 | <a href="#streams-ns-other">4.8.4.</a> | ||
298 | Other Namespaces<br /> | ||
299 | <a href="#streams-ns-declarations">4.8.5.</a> | ||
300 | Namespace Declarations and Prefixes<br /> | ||
301 | <a href="#streams-error">4.9.</a> | ||
302 | Stream Errors<br /> | ||
303 | <a href="#streams-error-rules">4.9.1.</a> | ||
304 | Rules<br /> | ||
305 | <a href="#streams-error-rules-unrecoverable">4.9.1.1.</a> | ||
306 | Stream Errors Are Unrecoverable<br /> | ||
307 | <a href="#streams-error-rules-setup">4.9.1.2.</a> | ||
308 | Stream Errors Can Occur During Setup<br /> | ||
309 | <a href="#streams-error-rules-host">4.9.1.3.</a> | ||
310 | Stream Errors When the Host Is Unspecified or Unknown<br /> | ||
311 | <a href="#streams-error-rules-where">4.9.1.4.</a> | ||
312 | Where Stream Errors Are Sent<br /> | ||
313 | <a href="#streams-error-syntax">4.9.2.</a> | ||
314 | Syntax<br /> | ||
315 | <a href="#streams-error-conditions">4.9.3.</a> | ||
316 | Defined Stream Error Conditions<br /> | ||
317 | <a href="#streams-error-conditions-bad-format">4.9.3.1.</a> | ||
318 | bad-format<br /> | ||
319 | <a href="#streams-error-conditions-bad-namespace-prefix">4.9.3.2.</a> | ||
320 | bad-namespace-prefix<br /> | ||
321 | <a href="#streams-error-conditions-conflict">4.9.3.3.</a> | ||
322 | conflict<br /> | ||
323 | <a href="#streams-error-conditions-connection-timeout">4.9.3.4.</a> | ||
324 | connection-timeout<br /> | ||
325 | <a href="#streams-error-conditions-host-gone">4.9.3.5.</a> | ||
326 | host-gone<br /> | ||
327 | <a href="#streams-error-conditions-host-unknown">4.9.3.6.</a> | ||
328 | host-unknown<br /> | ||
329 | <a href="#streams-error-conditions-improper-addressing">4.9.3.7.</a> | ||
330 | improper-addressing<br /> | ||
331 | <a href="#streams-error-conditions-internal-server-error">4.9.3.8.</a> | ||
332 | internal-server-error<br /> | ||
333 | <a href="#streams-error-conditions-invalid-from">4.9.3.9.</a> | ||
334 | invalid-from<br /> | ||
335 | <a href="#streams-error-conditions-invalid-namespace">4.9.3.10.</a> | ||
336 | invalid-namespace<br /> | ||
337 | <a href="#streams-error-conditions-invalid-xml">4.9.3.11.</a> | ||
338 | invalid-xml<br /> | ||
339 | <a href="#streams-error-conditions-not-authorized">4.9.3.12.</a> | ||
340 | not-authorized<br /> | ||
341 | <a href="#streams-error-conditions-not-well-formed">4.9.3.13.</a> | ||
342 | not-well-formed<br /> | ||
343 | <a href="#streams-error-conditions-policy-violation">4.9.3.14.</a> | ||
344 | policy-violation<br /> | ||
345 | <a href="#streams-error-conditions-remote-connection-failed">4.9.3.15.</a> | ||
346 | remote-connection-failed<br /> | ||
347 | <a href="#streams-error-conditions-reset">4.9.3.16.</a> | ||
348 | reset<br /> | ||
349 | <a href="#streams-error-conditions-resource-constraint">4.9.3.17.</a> | ||
350 | resource-constraint<br /> | ||
351 | <a href="#streams-error-conditions-restricted-xml">4.9.3.18.</a> | ||
352 | restricted-xml<br /> | ||
353 | <a href="#streams-error-conditions-see-other-host">4.9.3.19.</a> | ||
354 | see-other-host<br /> | ||
355 | <a href="#streams-error-conditions-system-shutdown">4.9.3.20.</a> | ||
356 | system-shutdown<br /> | ||
357 | <a href="#streams-error-conditions-undefined-condition">4.9.3.21.</a> | ||
358 | undefined-condition<br /> | ||
359 | <a href="#streams-error-conditions-unsupported-encoding">4.9.3.22.</a> | ||
360 | unsupported-encoding<br /> | ||
361 | <a href="#streams-error-conditions-unsupported-feature">4.9.3.23.</a> | ||
362 | unsupported-feature<br /> | ||
363 | <a href="#streams-error-conditions-unsupported-stanza-type">4.9.3.24.</a> | ||
364 | unsupported-stanza-type<br /> | ||
365 | <a href="#streams-error-conditions-unsupported-version">4.9.3.25.</a> | ||
366 | unsupported-version<br /> | ||
367 | <a href="#streams-error-app">4.9.4.</a> | ||
368 | Application-Specific Conditions<br /> | ||
369 | <a href="#streams-example">4.10.</a> | ||
370 | Simplified Stream Examples<br /> | ||
371 | <a href="#tls">5.</a> | ||
372 | STARTTLS Negotiation<br /> | ||
373 | <a href="#tls-fundamentals">5.1.</a> | ||
374 | Fundamentals<br /> | ||
375 | <a href="#tls-support">5.2.</a> | ||
376 | Support<br /> | ||
377 | <a href="#tls-rules">5.3.</a> | ||
378 | Stream Negotiation Rules<br /> | ||
379 | <a href="#tls-rules-mtn">5.3.1.</a> | ||
380 | Mandatory-to-Negotiate<br /> | ||
381 | <a href="#tls-rules-restart">5.3.2.</a> | ||
382 | Restart<br /> | ||
383 | <a href="#tls-rules-data">5.3.3.</a> | ||
384 | Data Formatting<br /> | ||
385 | <a href="#tls-rules-order">5.3.4.</a> | ||
386 | Order of TLS and SASL Negotiations<br /> | ||
387 | <a href="#tls-rules-renegotiation">5.3.5.</a> | ||
388 | TLS Renegotiation<br /> | ||
389 | <a href="#tls-rules-extensions">5.3.6.</a> | ||
390 | TLS Extensions<br /> | ||
391 | <a href="#tls-process">5.4.</a> | ||
392 | Process<br /> | ||
393 | <a href="#tls-process-stream">5.4.1.</a> | ||
394 | Exchange of Stream Headers and Stream Features<br /> | ||
395 | <a href="#tls-process-initiate">5.4.2.</a> | ||
396 | Initiation of STARTTLS Negotiation<br /> | ||
397 | <a href="#tls-process-initiate-command">5.4.2.1.</a> | ||
398 | STARTTLS Command<br /> | ||
399 | <a href="#tls-process-initiate-failure">5.4.2.2.</a> | ||
400 | Failure Case<br /> | ||
401 | <a href="#tls-process-initiate-proceed">5.4.2.3.</a> | ||
402 | Proceed Case<br /> | ||
403 | <a href="#tls-process-neg">5.4.3.</a> | ||
404 | TLS Negotiation<br /> | ||
405 | <a href="#tls-process-neg-rules">5.4.3.1.</a> | ||
406 | Rules<br /> | ||
407 | <a href="#tls-process-neg-failure">5.4.3.2.</a> | ||
408 | TLS Failure<br /> | ||
409 | <a href="#tls-process-neg-success">5.4.3.3.</a> | ||
410 | TLS Success<br /> | ||
411 | <a href="#sasl">6.</a> | ||
412 | SASL Negotiation<br /> | ||
413 | <a href="#sasl-fundamentals">6.1.</a> | ||
414 | Fundamentals<br /> | ||
415 | <a href="#sasl-support">6.2.</a> | ||
416 | Support<br /> | ||
417 | <a href="#sasl-rules">6.3.</a> | ||
418 | Stream Negotiation Rules<br /> | ||
419 | <a href="#sasl-rules-mtn">6.3.1.</a> | ||
420 | Mandatory-to-Negotiate<br /> | ||
421 | <a href="#sasl-rules-restart">6.3.2.</a> | ||
422 | Restart<br /> | ||
423 | <a href="#sasl-rules-preferences">6.3.3.</a> | ||
424 | Mechanism Preferences<br /> | ||
425 | <a href="#sasl-rules-offers">6.3.4.</a> | ||
426 | Mechanism Offers<br /> | ||
427 | <a href="#sasl-rules-data">6.3.5.</a> | ||
428 | Data Formatting<br /> | ||
429 | <a href="#sasl-rules-layers">6.3.6.</a> | ||
430 | Security Layers<br /> | ||
431 | <a href="#sasl-rules-username">6.3.7.</a> | ||
432 | Simple User Name<br /> | ||
433 | <a href="#sasl-rules-authzid">6.3.8.</a> | ||
434 | Authorization Identity<br /> | ||
435 | <a href="#sasl-rules-realms">6.3.9.</a> | ||
436 | Realms<br /> | ||
437 | <a href="#sasl-rules-roundtrips">6.3.10.</a> | ||
438 | Round Trips<br /> | ||
439 | <a href="#sasl-process">6.4.</a> | ||
440 | Process<br /> | ||
441 | <a href="#sasl-process-stream">6.4.1.</a> | ||
442 | Exchange of Stream Headers and Stream Features<br /> | ||
443 | <a href="#sasl-process-neg-initiate">6.4.2.</a> | ||
444 | Initiation<br /> | ||
445 | <a href="#sasl-process-neg-challengeresponse">6.4.3.</a> | ||
446 | Challenge-Response Sequence<br /> | ||
447 | <a href="#sasl-process-neg-abort">6.4.4.</a> | ||
448 | Abort<br /> | ||
449 | <a href="#sasl-process-neg-failure">6.4.5.</a> | ||
450 | SASL Failure<br /> | ||
451 | <a href="#sasl-process-neg-success">6.4.6.</a> | ||
452 | SASL Success<br /> | ||
453 | <a href="#sasl-errors">6.5.</a> | ||
454 | SASL Errors<br /> | ||
455 | <a href="#sasl-errors-aborted">6.5.1.</a> | ||
456 | aborted<br /> | ||
457 | <a href="#sasl-errors-account-disabled">6.5.2.</a> | ||
458 | account-disabled<br /> | ||
459 | <a href="#sasl-errors-credentials-expired">6.5.3.</a> | ||
460 | credentials-expired<br /> | ||
461 | <a href="#sasl-errors-encryption-required">6.5.4.</a> | ||
462 | encryption-required<br /> | ||
463 | <a href="#sasl-errors-incorrect-encoding">6.5.5.</a> | ||
464 | incorrect-encoding<br /> | ||
465 | <a href="#sasl-errors-invalid-authzid">6.5.6.</a> | ||
466 | invalid-authzid<br /> | ||
467 | <a href="#sasl-errors-invalid-mechanism">6.5.7.</a> | ||
468 | invalid-mechanism<br /> | ||
469 | <a href="#sasl-errors-malformed-request">6.5.8.</a> | ||
470 | malformed-request<br /> | ||
471 | <a href="#sasl-errors-mechanism-too-weak">6.5.9.</a> | ||
472 | mechanism-too-weak<br /> | ||
473 | <a href="#sasl-errors-not-authorized">6.5.10.</a> | ||
474 | not-authorized<br /> | ||
475 | <a href="#sasl-errors-temporary-auth-failure">6.5.11.</a> | ||
476 | temporary-auth-failure<br /> | ||
477 | <a href="#sasl-def">6.6.</a> | ||
478 | SASL Definition<br /> | ||
479 | <a href="#bind">7.</a> | ||
480 | Resource Binding<br /> | ||
481 | <a href="#bind-fundamentals">7.1.</a> | ||
482 | Fundamentals<br /> | ||
483 | <a href="#bind-support">7.2.</a> | ||
484 | Support<br /> | ||
485 | <a href="#bind-rules">7.3.</a> | ||
486 | Stream Negotiation Rules<br /> | ||
487 | <a href="#bind-rules-mtn">7.3.1.</a> | ||
488 | Mandatory-to-Negotiate<br /> | ||
489 | <a href="#bind-rules-restart">7.3.2.</a> | ||
490 | Restart<br /> | ||
491 | <a href="#bind-feature">7.4.</a> | ||
492 | Advertising Support<br /> | ||
493 | <a href="#bind-generation">7.5.</a> | ||
494 | Generation of Resource Identifiers<br /> | ||
495 | <a href="#bind-servergen">7.6.</a> | ||
496 | Server-Generated Resource Identifier<br /> | ||
497 | <a href="#bind-servergen-success">7.6.1.</a> | ||
498 | Success Case<br /> | ||
499 | <a href="#bind-servergen-error">7.6.2.</a> | ||
500 | Error Cases<br /> | ||
501 | <a href="#bind-servergen-error-resourceconstraint">7.6.2.1.</a> | ||
502 | Resource Constraint<br /> | ||
503 | <a href="#bind-servergen-error-notallowed">7.6.2.2.</a> | ||
504 | Not Allowed<br /> | ||
505 | <a href="#bind-clientsubmit">7.7.</a> | ||
506 | Client-Submitted Resource Identifier<br /> | ||
507 | <a href="#bind-clientsubmit-success">7.7.1.</a> | ||
508 | Success Case<br /> | ||
509 | <a href="#bind-clientsubmit-error">7.7.2.</a> | ||
510 | Error Cases<br /> | ||
511 | <a href="#bind-clientsubmit-error-badrequest">7.7.2.1.</a> | ||
512 | Bad Request<br /> | ||
513 | <a href="#bind-clientsubmit-error-conflict">7.7.2.2.</a> | ||
514 | Conflict<br /> | ||
515 | <a href="#bind-clientsubmit-retries">7.7.3.</a> | ||
516 | Retries<br /> | ||
517 | <a href="#stanzas">8.</a> | ||
518 | XML Stanzas<br /> | ||
519 | <a href="#stanzas-attributes">8.1.</a> | ||
520 | Common Attributes<br /> | ||
521 | <a href="#stanzas-attributes-to">8.1.1.</a> | ||
522 | to<br /> | ||
523 | <a href="#stanzas-attributes-to-c2s">8.1.1.1.</a> | ||
524 | Client-to-Server Streams<br /> | ||
525 | <a href="#stanzas-attributes-to-s2s">8.1.1.2.</a> | ||
526 | Server-to-Server Streams<br /> | ||
527 | <a href="#stanzas-attributes-from">8.1.2.</a> | ||
528 | from<br /> | ||
529 | <a href="#stanzas-attributes-from-c2s">8.1.2.1.</a> | ||
530 | Client-to-Server Streams<br /> | ||
531 | <a href="#stanzas-attributes-from-s2s">8.1.2.2.</a> | ||
532 | Server-to-Server Streams<br /> | ||
533 | <a href="#stanzas-attributes-id">8.1.3.</a> | ||
534 | id<br /> | ||
535 | <a href="#stanzas-attributes-type">8.1.4.</a> | ||
536 | type<br /> | ||
537 | <a href="#stanzas-attributes-lang">8.1.5.</a> | ||
538 | xml:lang<br /> | ||
539 | <a href="#stanzas-semantics">8.2.</a> | ||
540 | Basic Semantics<br /> | ||
541 | <a href="#stanzas-semantics-message">8.2.1.</a> | ||
542 | Message Semantics<br /> | ||
543 | <a href="#stanzas-semantics-presence">8.2.2.</a> | ||
544 | Presence Semantics<br /> | ||
545 | <a href="#stanzas-semantics-iq">8.2.3.</a> | ||
546 | IQ Semantics<br /> | ||
547 | <a href="#stanzas-error">8.3.</a> | ||
548 | Stanza Errors<br /> | ||
549 | <a href="#stanzas-error-rules">8.3.1.</a> | ||
550 | Rules<br /> | ||
551 | <a href="#stanzas-error-syntax">8.3.2.</a> | ||
552 | Syntax<br /> | ||
553 | <a href="#stanzas-error-conditions">8.3.3.</a> | ||
554 | Defined Conditions<br /> | ||
555 | <a href="#stanzas-error-conditions-bad-request">8.3.3.1.</a> | ||
556 | bad-request<br /> | ||
557 | <a href="#stanzas-error-conditions-conflict">8.3.3.2.</a> | ||
558 | conflict<br /> | ||
559 | <a href="#stanzas-error-conditions-feature-not-implemented">8.3.3.3.</a> | ||
560 | feature-not-implemented<br /> | ||
561 | <a href="#stanzas-error-conditions-forbidden">8.3.3.4.</a> | ||
562 | forbidden<br /> | ||
563 | <a href="#stanzas-error-conditions-gone">8.3.3.5.</a> | ||
564 | gone<br /> | ||
565 | <a href="#stanzas-error-conditions-internal-server-error">8.3.3.6.</a> | ||
566 | internal-server-error<br /> | ||
567 | <a href="#stanzas-error-conditions-item-not-found">8.3.3.7.</a> | ||
568 | item-not-found<br /> | ||
569 | <a href="#stanzas-error-conditions-jid-malformed">8.3.3.8.</a> | ||
570 | jid-malformed<br /> | ||
571 | <a href="#stanzas-error-conditions-not-acceptable">8.3.3.9.</a> | ||
572 | not-acceptable<br /> | ||
573 | <a href="#stanzas-error-conditions-not-allowed">8.3.3.10.</a> | ||
574 | not-allowed<br /> | ||
575 | <a href="#stanzas-error-conditions-not-authorized">8.3.3.11.</a> | ||
576 | not-authorized<br /> | ||
577 | <a href="#stanzas-error-conditions-policy-violation">8.3.3.12.</a> | ||
578 | policy-violation<br /> | ||
579 | <a href="#stanzas-error-conditions-recipient-unavailable">8.3.3.13.</a> | ||
580 | recipient-unavailable<br /> | ||
581 | <a href="#stanzas-error-conditions-redirect">8.3.3.14.</a> | ||
582 | redirect<br /> | ||
583 | <a href="#stanzas-error-conditions-registration-required">8.3.3.15.</a> | ||
584 | registration-required<br /> | ||
585 | <a href="#stanzas-error-conditions-remote-server-not-found">8.3.3.16.</a> | ||
586 | remote-server-not-found<br /> | ||
587 | <a href="#stanzas-error-conditions-remote-server-timeout">8.3.3.17.</a> | ||
588 | remote-server-timeout<br /> | ||
589 | <a href="#stanzas-error-conditions-resource-constraint">8.3.3.18.</a> | ||
590 | resource-constraint<br /> | ||
591 | <a href="#stanzas-error-conditions-service-unavailable">8.3.3.19.</a> | ||
592 | service-unavailable<br /> | ||
593 | <a href="#stanzas-error-conditions-subscription-required">8.3.3.20.</a> | ||
594 | subscription-required<br /> | ||
595 | <a href="#stanzas-error-conditions-undefined-condition">8.3.3.21.</a> | ||
596 | undefined-condition<br /> | ||
597 | <a href="#stanzas-error-conditions-unexpected-request">8.3.3.22.</a> | ||
598 | unexpected-request<br /> | ||
599 | <a href="#stanzas-error-app">8.3.4.</a> | ||
600 | Application-Specific Conditions<br /> | ||
601 | <a href="#stanzas-extended">8.4.</a> | ||
602 | Extended Content<br /> | ||
603 | <a href="#examples">9.</a> | ||
604 | Detailed Examples<br /> | ||
605 | <a href="#examples-c2s">9.1.</a> | ||
606 | Client-to-Server Examples<br /> | ||
607 | <a href="#examples-c2s-tls">9.1.1.</a> | ||
608 | TLS<br /> | ||
609 | <a href="#examples-c2s-sasl">9.1.2.</a> | ||
610 | SASL<br /> | ||
611 | <a href="#examples-c2s-bind">9.1.3.</a> | ||
612 | Resource Binding<br /> | ||
613 | <a href="#examples-c2s-stanzas">9.1.4.</a> | ||
614 | Stanza Exchange<br /> | ||
615 | <a href="#examples-c2s-close">9.1.5.</a> | ||
616 | Close<br /> | ||
617 | <a href="#examples-s2s">9.2.</a> | ||
618 | Server-to-Server Examples<br /> | ||
619 | <a href="#examples-s2s-tls">9.2.1.</a> | ||
620 | TLS<br /> | ||
621 | <a href="#examples-s2s-sasl">9.2.2.</a> | ||
622 | SASL<br /> | ||
623 | <a href="#examples-s2s-stanzas">9.2.3.</a> | ||
624 | Stanza Exchange<br /> | ||
625 | <a href="#examples-s2s-close">9.2.4.</a> | ||
626 | Close<br /> | ||
627 | <a href="#rules">10.</a> | ||
628 | Server Rules for Processing XML Stanzas<br /> | ||
629 | <a href="#rules-order">10.1.</a> | ||
630 | In-Order Processing<br /> | ||
631 | <a href="#rules-gen">10.2.</a> | ||
632 | General Considerations<br /> | ||
633 | <a href="#rules-noto">10.3.</a> | ||
634 | No 'to' Address<br /> | ||
635 | <a href="#rules-noto-message">10.3.1.</a> | ||
636 | Message<br /> | ||
637 | <a href="#rules-noto-presence">10.3.2.</a> | ||
638 | Presence<br /> | ||
639 | <a href="#rules-noto-IQ">10.3.3.</a> | ||
640 | IQ<br /> | ||
641 | <a href="#rules-remote">10.4.</a> | ||
642 | Remote Domain<br /> | ||
643 | <a href="#rules-remote-existing">10.4.1.</a> | ||
644 | Existing Stream<br /> | ||
645 | <a href="#rules-remote-nostream">10.4.2.</a> | ||
646 | No Existing Stream<br /> | ||
647 | <a href="#rules-remote-error">10.4.3.</a> | ||
648 | Error Handling<br /> | ||
649 | <a href="#rules-local">10.5.</a> | ||
650 | Local Domain<br /> | ||
651 | <a href="#rules-local-domain">10.5.1.</a> | ||
652 | domainpart<br /> | ||
653 | <a href="#rules-local-domainresource">10.5.2.</a> | ||
654 | domainpart/resourcepart<br /> | ||
655 | <a href="#rules-local-barejid">10.5.3.</a> | ||
656 | localpart@domainpart<br /> | ||
657 | <a href="#rules-local-barejid-nosuchuser">10.5.3.1.</a> | ||
658 | No Such User<br /> | ||
659 | <a href="#rules-local-barejid-userexists">10.5.3.2.</a> | ||
660 | User Exists<br /> | ||
661 | <a href="#rules-local-fulljid">10.5.4.</a> | ||
662 | localpart@domainpart/resourcepart<br /> | ||
663 | <a href="#xml">11.</a> | ||
664 | XML Usage<br /> | ||
665 | <a href="#xml-restrictions">11.1.</a> | ||
666 | XML Restrictions<br /> | ||
667 | <a href="#xml-ns">11.2.</a> | ||
668 | XML Namespace Names and Prefixes<br /> | ||
669 | <a href="#xml-wellformed">11.3.</a> | ||
670 | Well-Formedness<br /> | ||
671 | <a href="#xml-validation">11.4.</a> | ||
672 | Validation<br /> | ||
673 | <a href="#xml-declaration">11.5.</a> | ||
674 | Inclusion of XML Declaration<br /> | ||
675 | <a href="#xml-encoding">11.6.</a> | ||
676 | Character Encoding<br /> | ||
677 | <a href="#xml-whitespace">11.7.</a> | ||
678 | Whitespace<br /> | ||
679 | <a href="#xml-versions">11.8.</a> | ||
680 | XML Versions<br /> | ||
681 | <a href="#i18n">12.</a> | ||
682 | Internationalization Considerations<br /> | ||
683 | <a href="#security">13.</a> | ||
684 | Security Considerations<br /> | ||
685 | <a href="#security-fundamentals">13.1.</a> | ||
686 | Fundamentals<br /> | ||
687 | <a href="#security-threats">13.2.</a> | ||
688 | Threat Model<br /> | ||
689 | <a href="#security-layers">13.3.</a> | ||
690 | Order of Layers<br /> | ||
691 | <a href="#security-confidentiality">13.4.</a> | ||
692 | Confidentiality and Integrity<br /> | ||
693 | <a href="#security-authentication">13.5.</a> | ||
694 | Peer Entity Authentication<br /> | ||
695 | <a href="#security-strong">13.6.</a> | ||
696 | Strong Security<br /> | ||
697 | <a href="#security-certificates">13.7.</a> | ||
698 | Certificates<br /> | ||
699 | <a href="#security-certificates-generation">13.7.1.</a> | ||
700 | Certificate Generation<br /> | ||
701 | <a href="#security-certificates-generation-general">13.7.1.1.</a> | ||
702 | General Considerations<br /> | ||
703 | <a href="#security-certificates-generation-server">13.7.1.2.</a> | ||
704 | Server Certificates<br /> | ||
705 | <a href="#security-certificates-generation-client">13.7.1.3.</a> | ||
706 | Client Certificates<br /> | ||
707 | <a href="#security-certificates-generation-xmppaddr">13.7.1.4.</a> | ||
708 | XmppAddr Identifier Type<br /> | ||
709 | <a href="#security-certificates-validation">13.7.2.</a> | ||
710 | Certificate Validation<br /> | ||
711 | <a href="#security-certificates-validation-server">13.7.2.1.</a> | ||
712 | Server Certificates<br /> | ||
713 | <a href="#security-certificates-validation-client">13.7.2.2.</a> | ||
714 | Client Certificates<br /> | ||
715 | <a href="#security-certificates-validation-streams">13.7.2.3.</a> | ||
716 | Checking of Certificates in Long-Lived Streams<br /> | ||
717 | <a href="#security-certificates-validation-extensions">13.7.2.4.</a> | ||
718 | Use of Certificates in XMPP Extensions<br /> | ||
719 | <a href="#security-mti">13.8.</a> | ||
720 | Mandatory-to-Implement TLS and SASL Technologies<br /> | ||
721 | <a href="#security-mti-auth">13.8.1.</a> | ||
722 | For Authentication Only<br /> | ||
723 | <a href="#security-mti-conf">13.8.2.</a> | ||
724 | For Confidentiality Only<br /> | ||
725 | <a href="#security-mti-bothpass">13.8.3.</a> | ||
726 | For Confidentiality and Authentication with Passwords<br /> | ||
727 | <a href="#security-mti-bothnopass">13.8.4.</a> | ||
728 | For Confidentiality and Authentication without Passwords<br /> | ||
729 | <a href="#security-reuse">13.9.</a> | ||
730 | Technology Reuse<br /> | ||
731 | <a href="#security-reuse-base64">13.9.1.</a> | ||
732 | Use of Base 64 in SASL<br /> | ||
733 | <a href="#security-reuse-dns">13.9.2.</a> | ||
734 | Use of DNS<br /> | ||
735 | <a href="#security-reuse-hash">13.9.3.</a> | ||
736 | Use of Hash Functions<br /> | ||
737 | <a href="#security-reuse-sasl">13.9.4.</a> | ||
738 | Use of SASL<br /> | ||
739 | <a href="#security-reuse-tls">13.9.5.</a> | ||
740 | Use of TLS<br /> | ||
741 | <a href="#security-reuse-utf8">13.9.6.</a> | ||
742 | Use of UTF-8<br /> | ||
743 | <a href="#security-reuse-xml">13.9.7.</a> | ||
744 | Use of XML<br /> | ||
745 | <a href="#security-leaks">13.10.</a> | ||
746 | Information Leaks<br /> | ||
747 | <a href="#security-leaks-ipaddress">13.10.1.</a> | ||
748 | IP Addresses<br /> | ||
749 | <a href="#security-leaks-presence">13.10.2.</a> | ||
750 | Presence Information<br /> | ||
751 | <a href="#security-harvesting">13.11.</a> | ||
752 | Directory Harvesting<br /> | ||
753 | <a href="#security-dos">13.12.</a> | ||
754 | Denial of Service<br /> | ||
755 | <a href="#security-firewalls">13.13.</a> | ||
756 | Firewalls<br /> | ||
757 | <a href="#security-federation">13.14.</a> | ||
758 | Interdomain Federation<br /> | ||
759 | <a href="#security-nonrepudiation">13.15.</a> | ||
760 | Non-Repudiation<br /> | ||
761 | <a href="#iana">14.</a> | ||
762 | IANA Considerations<br /> | ||
763 | <a href="#iana-ns-tls">14.1.</a> | ||
764 | XML Namespace Name for TLS Data<br /> | ||
765 | <a href="#iana-ns-sasl">14.2.</a> | ||
766 | XML Namespace Name for SASL Data<br /> | ||
767 | <a href="#iana-ns-streams">14.3.</a> | ||
768 | XML Namespace Name for Stream Errors<br /> | ||
769 | <a href="#iana-ns-bind">14.4.</a> | ||
770 | XML Namespace Name for Resource Binding<br /> | ||
771 | <a href="#iana-ns-stanzas">14.5.</a> | ||
772 | XML Namespace Name for Stanza Errors<br /> | ||
773 | <a href="#iana-gssapi">14.6.</a> | ||
774 | GSSAPI Service Name<br /> | ||
775 | <a href="#iana-ports">14.7.</a> | ||
776 | Port Numbers and Service Names<br /> | ||
777 | <a href="#conformance">15.</a> | ||
778 | Conformance Requirements<br /> | ||
779 | <a href="#rfc.references1">16.</a> | ||
780 | References<br /> | ||
781 | <a href="#rfc.references1">16.1.</a> | ||
782 | Normative References<br /> | ||
783 | <a href="#rfc.references2">16.2.</a> | ||
784 | Informative References<br /> | ||
785 | <a href="#schema">Appendix A.</a> | ||
786 | XML Schemas<br /> | ||
787 | <a href="#schemas-stream">A.1.</a> | ||
788 | Stream Namespace<br /> | ||
789 | <a href="#schemas-streamerror">A.2.</a> | ||
790 | Stream Error Namespace<br /> | ||
791 | <a href="#schemas-starttls">A.3.</a> | ||
792 | STARTTLS Namespace<br /> | ||
793 | <a href="#schemas-sasl">A.4.</a> | ||
794 | SASL Namespace<br /> | ||
795 | <a href="#schemas-client">A.5.</a> | ||
796 | Client Namespace<br /> | ||
797 | <a href="#schemas-server">A.6.</a> | ||
798 | Server Namespace<br /> | ||
799 | <a href="#schemas-bind">A.7.</a> | ||
800 | Resource Binding Namespace<br /> | ||
801 | <a href="#schemas-stanzaerror">A.8.</a> | ||
802 | Stanza Error Namespace<br /> | ||
803 | <a href="#contact">Appendix B.</a> | ||
804 | Contact Addresses<br /> | ||
805 | <a href="#provisioning">Appendix C.</a> | ||
806 | Account Provisioning<br /> | ||
807 | <a href="#diffs">Appendix D.</a> | ||
808 | Differences from RFC 3920<br /> | ||
809 | <a href="#intro-ack">Appendix E.</a> | ||
810 | Acknowledgements<br /> | ||
811 | </p> | ||
812 | <br clear="all" /> | ||
813 | |||
814 | <a name="intro"></a><br /><hr /> | ||
815 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
816 | <a name="rfc.section.1"></a><h3>1. | ||
817 | Introduction</h3> | ||
818 | |||
819 | <a name="intro-overview"></a><br /><hr /> | ||
820 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
821 | <a name="rfc.section.1.1"></a><h3>1.1. | ||
822 | Overview</h3> | ||
823 | |||
824 | <p>The Extensible Messaging and Presence Protocol (XMPP) is an application profile of the Extensible Markup Language <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> that enables the near-real-time exchange of structured yet extensible data between any two or more network entities. This document defines XMPP's core protocol methods: setup and teardown of XML streams, channel encryption, authentication, error handling, and communication primitives for messaging, network availability ("presence"), and request-response interactions. | ||
825 | </p> | ||
826 | <a name="intro-history"></a><br /><hr /> | ||
827 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
828 | <a name="rfc.section.1.2"></a><h3>1.2. | ||
829 | History</h3> | ||
830 | |||
831 | <p>The basic syntax and semantics of XMPP were developed originally within the Jabber open-source community, mainly in 1999. In late 2002, the XMPP Working Group was chartered with developing an adaptation of the base Jabber protocol that would be suitable as an IETF instant messaging (IM) and presence technology in accordance with <a class='info' href='#IMP-REQS'>[IMP‑REQS]<span> (</span><span class='info'>Day, M., Aggarwal, S., and J. Vincent, “Instant Messaging / Presence Protocol Requirements,” February 2000.</span><span>)</span></a>. In October 2004, <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a> and <a class='info' href='#RFC3921'>[RFC3921]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” October 2004.</span><span>)</span></a> were published, representing the most complete definition of XMPP at that time. | ||
832 | </p> | ||
833 | <p>Since 2004 the Internet community has gained extensive implementation and deployment experience with XMPP, including formal interoperability testing carried out under the auspices of the XMPP Standards Foundation (XSF). This document incorporates comprehensive feedback from software developers and XMPP service providers, including a number of backward-compatible modifications summarized under <a class='info' href='#diffs'>Appendix D<span> (</span><span class='info'>Differences from RFC 3920</span><span>)</span></a>. As a result, this document reflects the rough consensus of the Internet community regarding the core features of XMPP 1.0, thus obsoleting RFC 3920. | ||
834 | </p> | ||
835 | <a name="intro-summary"></a><br /><hr /> | ||
836 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
837 | <a name="rfc.section.1.3"></a><h3>1.3. | ||
838 | Functional Summary</h3> | ||
839 | |||
840 | <p>This non-normative section provides a developer-friendly, functional summary of XMPP; refer to the sections that follow for a normative definition of XMPP. | ||
841 | </p> | ||
842 | <p>The purpose of XMPP is to enable the exchange of relatively small pieces of structured data (called "XML stanzas") over a network between any two (or more) entities. XMPP is typically implemented using a distributed client-server architecture, wherein a client needs to connect to a server in order to gain access to the network and thus be allowed to exchange XML stanzas with other entities (which can be associated with other servers). The process whereby a client connects to a server, exchanges XML stanzas, and ends the connection is: | ||
843 | </p> | ||
844 | <p> | ||
845 | </p> | ||
846 | <ol class="text"> | ||
847 | <li>Determine the IP address and port at which to connect, | ||
848 | typically based on resolution of a fully qualified domain name (<a class='info' href='#tcp-resolution'>Section 3.2<span> (</span><span class='info'>Resolution of Fully Qualified Domain Names</span><span>)</span></a>) | ||
849 | </li> | ||
850 | <li>Open a Transmission Control Protocol <a class='info' href='#TCP'>[TCP]<span> (</span><span class='info'>Postel, J., “Transmission Control Protocol,” September 1981.</span><span>)</span></a> connection | ||
851 | </li> | ||
852 | <li>Open an XML stream over TCP (<a class='info' href='#streams-open'>Section 4.2<span> (</span><span class='info'>Opening a Stream</span><span>)</span></a>) | ||
853 | </li> | ||
854 | <li>Preferably negotiate Transport Layer Security <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a> for channel encryption (<a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>) | ||
855 | </li> | ||
856 | <li>Authenticate using a Simple Authentication and Security Layer <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a> mechanism (<a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>) | ||
857 | </li> | ||
858 | <li>Bind a resource to the stream (<a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>) | ||
859 | </li> | ||
860 | <li>Exchange an unbounded number of XML stanzas with other entities on the network (<a class='info' href='#stanzas'>Section 8<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a>) | ||
861 | </li> | ||
862 | <li>Close the XML stream (<a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>) | ||
863 | </li> | ||
864 | <li>Close the TCP connection | ||
865 | </li> | ||
866 | </ol><p> | ||
867 | |||
868 | </p> | ||
869 | <p>Within XMPP, one server can optionally connect to another server to enable inter-domain or inter-server communication. For this to happen, the two servers need to negotiate a connection between themselves and then exchange XML stanzas; the process for doing so is: | ||
870 | </p> | ||
871 | <p> | ||
872 | </p> | ||
873 | <ol class="text"> | ||
874 | <li>Determine the IP address and port at which to connect, | ||
875 | typically based on resolution of a fully qualified domain name (<a class='info' href='#tcp-resolution'>Section 3.2<span> (</span><span class='info'>Resolution of Fully Qualified Domain Names</span><span>)</span></a>) | ||
876 | </li> | ||
877 | <li>Open a TCP connection | ||
878 | </li> | ||
879 | <li>Open an XML stream (<a class='info' href='#streams-open'>Section 4.2<span> (</span><span class='info'>Opening a Stream</span><span>)</span></a>) | ||
880 | </li> | ||
881 | <li>Preferably negotiate TLS for channel encryption (<a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>) | ||
882 | </li> | ||
883 | <li>Authenticate using a Simple Authentication and Security Layer <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a> mechanism (<a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>) * | ||
884 | </li> | ||
885 | <li>Exchange an unbounded number of XML stanzas both directly for the servers and indirectly on behalf of entities associated with each server, such as connected clients (<a class='info' href='#stanzas'>Section 8<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a>) | ||
886 | </li> | ||
887 | <li>Close the XML stream (<a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>) | ||
888 | </li> | ||
889 | <li>Close the TCP connection | ||
890 | </li> | ||
891 | </ol><p> | ||
892 | |||
893 | </p> | ||
894 | <p></p> | ||
895 | <blockquote class="text"> | ||
896 | <p>* Interoperability Note: At the time of writing, most deployed servers still use the Server Dialback protocol <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a> to provide weak identity verification instead of using SASL with PKIX certificates to provide strong authentication, especially in cases where SASL negotiation would not result in strong authentication anyway (e.g., because TLS negotiation was not mandated by the peer server, or because the PKIX certificate presented by the peer server during TLS negotiation is self-signed and has not been previously accepted); for details, see <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>. The solutions specified in this document offer a significantly stronger level of security (see also <a class='info' href='#security-strong'>Section 13.6<span> (</span><span class='info'>Strong Security</span><span>)</span></a>). | ||
897 | </p> | ||
898 | </blockquote> | ||
899 | |||
900 | <p>This document specifies how clients connect to servers and specifies the basic semantics of XML stanzas. However, this document does not define the "payloads" of the XML stanzas that might be exchanged once a connection is successfully established; instead, those payloads are defined by various XMPP extensions. For example, <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a> defines extensions for basic instant messaging and presence functionality. In addition, various specifications produced in the XSF's XEP series <a class='info' href='#XEP-0001'>[XEP‑0001]<span> (</span><span class='info'>Saint-Andre, P., “XMPP Extension Protocols,” March 2010.</span><span>)</span></a> define extensions for a wide range of applications. | ||
901 | </p> | ||
902 | <a name="intro-terms"></a><br /><hr /> | ||
903 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
904 | <a name="rfc.section.1.4"></a><h3>1.4. | ||
905 | Terminology</h3> | ||
906 | |||
907 | <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 <a class='info' href='#KEYWORDS'>[KEYWORDS]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a>. | ||
908 | </p> | ||
909 | <p>Certain security-related terms are to be understood in the sense defined in <a class='info' href='#SEC-TERMS'>[SEC‑TERMS]<span> (</span><span class='info'>Shirey, R., “Internet Security Glossary, Version 2,” August 2007.</span><span>)</span></a>; such terms include, but are not limited to, "assurance", "attack", "authentication", "authorization", "certificate", "certification authority", "certification path", "confidentiality", "credential", "downgrade", "encryption", "hash value", "identity", "integrity", "signature", "self-signed certificate", "sign", "spoof", "tamper", "trust", "trust anchor", "validate", and "verify". | ||
910 | </p> | ||
911 | <p>Certain terms related to certificates, domains, and application service identity are to be understood in the sense defined in <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a>; these include, but are not limited to, "PKIX certificate", "source domain", "derived domain", and the identifier types "CN-ID", "DNS-ID", and "SRV-ID". | ||
912 | </p> | ||
913 | <p>Other security-related terms are to be understood in the sense defined in the referenced specifications (for example, "denial of service" as described in <a class='info' href='#DOS'>[DOS]<span> (</span><span class='info'>Handley, M., Rescorla, E., and IAB, “Internet Denial-of-Service Considerations,” December 2006.</span><span>)</span></a> or "end entity certificate" as described in <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>). | ||
914 | </p> | ||
915 | <p>The term "whitespace" is used to refer to any character or characters matching the "S" production from <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>, i.e., one or more instances of the SP, HTAB, CR, or LF rules defined in <a class='info' href='#ABNF'>[ABNF]<span> (</span><span class='info'>Crocker, D. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF,” January 2008.</span><span>)</span></a>. | ||
916 | </p> | ||
917 | <p>The terms "localpart", "domainpart", and "resourcepart" are defined in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>. | ||
918 | </p> | ||
919 | <p>The term "bare JID" refers to an XMPP address of the form <localpart@domainpart> (for an account at a server) or of the form <domainpart> (for a server). | ||
920 | </p> | ||
921 | <p>The term "full JID" refers to an XMPP address of the form <localpart@domainpart/resourcepart> (for a particular authorized client or device associated with an account) or of the form <domainpart/resourcepart> (for a particular resource or script associated with a server). | ||
922 | </p> | ||
923 | <p>The term "XML stream" (also "stream") is defined under <a class='info' href='#streams-fundamentals'>Section 4.1<span> (</span><span class='info'>Stream Fundamentals</span><span>)</span></a>. | ||
924 | </p> | ||
925 | <p>The term "XML stanza" (also "stanza") is defined under <a class='info' href='#streams-fundamentals'>Section 4.1<span> (</span><span class='info'>Stream Fundamentals</span><span>)</span></a>. There are three kinds of stanzas: message, | ||
926 | presence, and IQ (short for "Info/Query"). These communication primitives are | ||
927 | defined under Sections <a class='info' href='#stanzas-semantics-message'>8.2.1<span> (</span><span class='info'>Message Semantics</span><span>)</span></a>, <a class='info' href='#stanzas-semantics-presence'>8.2.2<span> (</span><span class='info'>Presence Semantics</span><span>)</span></a>, and <a class='info' href='#stanzas-semantics-iq'>8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>, respectively. | ||
928 | </p> | ||
929 | <p>The term "originating entity" refers to the entity that first generates a stanza that is sent over an XMPP network (e.g., a connected client, an add-on service, or a server). The term "generated stanza" refers to the stanza so generated. | ||
930 | </p> | ||
931 | <p>The term "input stream" designates an XML stream over which a server receives data from a connected client or remote server, and the term "output stream" designates an XML stream over which a server sends data to a connected client or remote server. The following terms designate some of the actions that a server can perform when processing data received over an input stream: | ||
932 | </p> | ||
933 | <p> | ||
934 | </p> | ||
935 | <blockquote class="text"> | ||
936 | <p> | ||
937 | </p> | ||
938 | <blockquote class="text"><dl> | ||
939 | <dt>route:</dt> | ||
940 | <dd>pass the data to a remote server for direct processing by the remote server or eventual delivery to a client associated with the remote server | ||
941 | </dd> | ||
942 | <dt>deliver:</dt> | ||
943 | <dd>pass the data to a connected client | ||
944 | </dd> | ||
945 | <dt>ignore:</dt> | ||
946 | <dd>discard the data without acting upon it or returning an error to the sender | ||
947 | </dd> | ||
948 | </dl></blockquote> | ||
949 | |||
950 | |||
951 | </blockquote><p> | ||
952 | |||
953 | </p> | ||
954 | <p>When the term "ignore" is used with regard to client processing of data it receives, the phrase "without acting upon it" explicitly includes not presenting the data to a human user. | ||
955 | </p> | ||
956 | <p>Following the "XML Notation" used in <a class='info' href='#IRI'>[IRI]<span> (</span><span class='info'>Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.</span><span>)</span></a> to represent characters that cannot be rendered in ASCII-only documents, some examples in this document use the form "&#x...." as a notational device to represent <a class='info' href='#UNICODE'>[UNICODE]<span> (</span><span class='info'>The Unicode Consortium, “The Unicode Standard, Version 6.0,” 2010.</span><span>)</span></a> characters (e.g., the string "&#x0159;" stands for the Unicode character LATIN SMALL LETTER R WITH CARON); this form is definitely not to be sent over the wire in XMPP systems. | ||
957 | </p> | ||
958 | <p>Consistent with the convention used in <a class='info' href='#URI'>[URI]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a> | ||
959 | to represent Uniform Resource Identifiers, XMPP addresses in running text are enclosed between '<' and '>' (although natively they are not URIs). | ||
960 | </p> | ||
961 | <p>In examples, lines have been wrapped for improved readability, "[...]" means elision, and the following prepended strings are used (these prepended strings are not to be sent over the wire): | ||
962 | </p> | ||
963 | <p> | ||
964 | </p> | ||
965 | <ul class="text"> | ||
966 | <li>C: = a client | ||
967 | </li> | ||
968 | <li>E: = any XMPP entity | ||
969 | </li> | ||
970 | <li>I: = an initiating entity | ||
971 | </li> | ||
972 | <li>P: = a peer server | ||
973 | </li> | ||
974 | <li>R: = a receiving entity | ||
975 | </li> | ||
976 | <li>S: = a server | ||
977 | </li> | ||
978 | <li>S1: = server1 | ||
979 | </li> | ||
980 | <li>S2: = server2 | ||
981 | </li> | ||
982 | </ul><p> | ||
983 | |||
984 | </p> | ||
985 | <p>Readers need to be aware that the examples are not exhaustive and that, in examples for some protocol flows, the alternate steps shown would not necessarily be triggered by the exact data sent in the previous step; in all cases the protocol definitions specified in this document or in normatively referenced documents rule over any examples provided here. All examples are fictional and the information exchanged (e.g., usernames and passwords) does not represent any existing users or servers. | ||
986 | </p> | ||
987 | <a name="arch"></a><br /><hr /> | ||
988 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
989 | <a name="rfc.section.2"></a><h3>2. | ||
990 | Architecture</h3> | ||
991 | |||
992 | <p>XMPP provides a technology for the asynchronous, end-to-end | ||
993 | exchange of structured data by means of direct, persistent XML | ||
994 | streams among a distributed network of globally addressable, presence-aware clients and servers. Because this architectural style involves ubiquitous knowledge of network availability and a conceptually unlimited number of concurrent information transactions in the context of a given client-to-server or server-to-server session, we label it "Availability for Concurrent Transactions" (ACT) to distinguish it from the "Representational State Transfer" <a class='info' href='#REST'>[REST]<span> (</span><span class='info'>Fielding, R., “Architectural Styles and the Design of Network-based Software Architectures,” .</span><span>)</span></a> architectural style familiar from the World Wide Web. Although the architecture of XMPP is similar in important ways to that of email (see <a class='info' href='#EMAIL-ARCH'>[EMAIL‑ARCH]<span> (</span><span class='info'>Crocker, D., “Internet Mail Architecture,” July 2009.</span><span>)</span></a>), it introduces several modifications to facilitate communication in close to real time. The salient features of this ACTive architectural style are as follows. | ||
995 | </p> | ||
996 | <a name="arch-addresses"></a><br /><hr /> | ||
997 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
998 | <a name="rfc.section.2.1"></a><h3>2.1. | ||
999 | Global Addresses</h3> | ||
1000 | |||
1001 | <p>As with email, XMPP uses globally unique addresses (based on the Domain Name System) in order to route and deliver messages over the network. All XMPP entities are addressable on the network, most particularly clients and servers but also various additional services that can be accessed by clients and servers. In general, server addresses are of the form <domainpart> (e.g., <im.example.com>), accounts hosted at a server are of the form <localpart@domainpart> (e.g., <juliet@im.example.com>, called a "bare JID"), and a particular connected device or resource that is currently authorized for interaction on behalf of an account is of the form <localpart@domainpart/resourcepart> (e.g., <juliet@im.example.com/balcony>, called a "full JID"). For historical reasons, XMPP addresses are often called Jabber IDs or JIDs. Because the formal specification of the XMPP address format depends on internationalization technologies that are in flux at the time of writing, the format is defined in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a> instead of this document. The terms "localpart", "domainpart", and "resourcepart" are defined more formally in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>. | ||
1002 | </p> | ||
1003 | <a name="arch-presence"></a><br /><hr /> | ||
1004 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1005 | <a name="rfc.section.2.2"></a><h3>2.2. | ||
1006 | Presence</h3> | ||
1007 | |||
1008 | <p>XMPP includes the ability for an entity to advertise its network availability or "presence" to other entities. In XMPP, this availability for communication is signaled end-to-end by means of a dedicated communication primitive: the <presence/> stanza. Although knowledge of network availability is not strictly necessary for the exchange of XMPP messages, it facilitates real-time interaction because the originator of a message can know before initiating communication that the intended recipient is online and available. End-to-end presence is defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>. | ||
1009 | </p> | ||
1010 | <a name="arch-streams"></a><br /><hr /> | ||
1011 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1012 | <a name="rfc.section.2.3"></a><h3>2.3. | ||
1013 | Persistent Streams</h3> | ||
1014 | |||
1015 | <p>Availability for communication is also built into each point-to-point "hop" through the use of persistent XML streams over long-lived TCP connections. These "always-on" client-to-server and server-to-server streams enable each party to push data to the other party at any time for immediate routing or delivery. XML streams are defined under <a class='info' href='#streams'>Section 4<span> (</span><span class='info'>XML Streams</span><span>)</span></a>. | ||
1016 | </p> | ||
1017 | <a name="arch-data"></a><br /><hr /> | ||
1018 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1019 | <a name="rfc.section.2.4"></a><h3>2.4. | ||
1020 | Structured Data</h3> | ||
1021 | |||
1022 | <p>The basic protocol data unit in XMPP is not an XML stream (which simply provides the transport for point-to-point communication) but an XML "stanza", which is essentially a fragment of XML that is sent over a stream. The root element of a stanza includes routing attributes (such as "from" and "to" addresses), and the child elements of the stanza contain a payload for delivery to the intended recipient. XML stanzas are defined under <a class='info' href='#stanzas'>Section 8<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a>. | ||
1023 | </p> | ||
1024 | <a name="arch-network"></a><br /><hr /> | ||
1025 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1026 | <a name="rfc.section.2.5"></a><h3>2.5. | ||
1027 | Distributed Network of Clients and Servers</h3> | ||
1028 | |||
1029 | <p>In practice, XMPP consists of a network of clients and servers that inter-communicate (however, communication between any two given deployed servers is strictly discretionary and a matter of local service policy). Thus, for example, the user <juliet@im.example.com> associated with the server <im.example.com> might be able to exchange messages, presence, and other structured data with the user <romeo@example.net> associated with the server <example.net>. This pattern is familiar from messaging protocols that make use of global addresses, such as the email network (see <a class='info' href='#SMTP'>[SMTP]<span> (</span><span class='info'>Klensin, J., “Simple Mail Transfer Protocol,” October 2008.</span><span>)</span></a> and <a class='info' href='#EMAIL-ARCH'>[EMAIL‑ARCH]<span> (</span><span class='info'>Crocker, D., “Internet Mail Architecture,” July 2009.</span><span>)</span></a>). As a result, end-to-end communication in XMPP is logically peer-to-peer but physically client-to-server-to-server-to-client, as illustrated in the following diagram. | ||
1030 | </p><br /><hr class="insert" /> | ||
1031 | <a name="figure-1"></a> | ||
1032 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1033 | example.net <--------------> im.example.com | ||
1034 | ^ ^ | ||
1035 | | | | ||
1036 | v v | ||
1037 | romeo@example.net juliet@im.example.com | ||
1038 | |||
1039 | </pre></div><table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b> Figure 1: Distributed Client-Server Architecture </b></font><br /></td></tr></table><hr class="insert" /> | ||
1040 | |||
1041 | <p></p> | ||
1042 | <blockquote class="text"> | ||
1043 | <p>Informational Note: Architectures that employ <a class='info' href='#streams'>XML streams<span> (</span><span class='info'>XML Streams</span><span>)</span></a> and <a class='info' href='#stanzas'>XML stanzas<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a> but that establish peer-to-peer connections directly between clients using technologies based on <a class='info' href='#LINKLOCAL'>[LINKLOCAL]<span> (</span><span class='info'>Cheshire, S., Aboba, B., and E. Guttman, “Dynamic Configuration of IPv4 Link-Local Addresses,” May 2005.</span><span>)</span></a> have been deployed, but such architectures are not defined in this specification and are best described as "XMPP-like"; for details, see <a class='info' href='#XEP-0174'>[XEP‑0174]<span> (</span><span class='info'>Saint-Andre, P., “Link-Local Messaging,” November 2008.</span><span>)</span></a>. In addition, XML streams can be established end-to-end over any reliable transport, including extensions to XMPP itself; however, such methods are out of scope for this specification. | ||
1044 | </p> | ||
1045 | </blockquote> | ||
1046 | |||
1047 | <p>The following paragraphs describe the responsibilities of clients and servers on the network. | ||
1048 | </p> | ||
1049 | <p>A client is an entity that establishes an XML stream with a server by authenticating using the credentials of a registered account (via <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>) and that then completes <a class='info' href='#bind'>resource binding<span> (</span><span class='info'>Resource Binding</span><span>)</span></a> in order to enable delivery of XML stanzas between the server and the client over the negotiated stream. The client then uses XMPP to communicate with its server, other clients, and any other entities on the network, where the server is responsible for delivering stanzas to other connected clients at the same server or routing them to remote servers. Multiple clients can connect simultaneously to a server on behalf of the same registered account, where each client is differentiated by the resourcepart of an XMPP address (e.g., <juliet@im.example.com/balcony> vs. <juliet@im.example.com/chamber>), as defined under <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a> and <a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>. | ||
1050 | </p> | ||
1051 | <p>A server is an entity whose primary responsibilities are to: | ||
1052 | </p> | ||
1053 | <p> | ||
1054 | </p> | ||
1055 | <ul class="text"> | ||
1056 | <li>Manage <a class='info' href='#streams'>XML streams<span> (</span><span class='info'>XML Streams</span><span>)</span></a> with connected clients and deliver <a class='info' href='#stanzas'>XML stanzas<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a> to those clients over the negotiated streams; this includes responsibility for ensuring that a client authenticates with the server before being granted access to the XMPP network. | ||
1057 | </li> | ||
1058 | <li>Subject to local service policies on server-to-server communication, manage <a class='info' href='#streams'>XML streams<span> (</span><span class='info'>XML Streams</span><span>)</span></a> with remote servers and route <a class='info' href='#stanzas'>XML stanzas<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a> to those servers over the negotiated streams. | ||
1059 | </li> | ||
1060 | </ul><p> | ||
1061 | |||
1062 | </p> | ||
1063 | <p>Depending on the application, the secondary responsibilities of an XMPP server can include: | ||
1064 | </p> | ||
1065 | <p> | ||
1066 | </p> | ||
1067 | <ul class="text"> | ||
1068 | <li>Storing data that is used by clients (e.g., contact lists for users of XMPP-based instant messaging and presence applications as defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>); in this case, the relevant XML stanza is handled directly by the server itself on behalf of the client and is not routed to a remote server or delivered to a connected client. | ||
1069 | </li> | ||
1070 | <li>Hosting add-on services that also use XMPP as the basis for communication but that provide additional functionality beyond that defined in this document or in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>; examples include multi-user conferencing services as specified in <a class='info' href='#XEP-0045'>[XEP‑0045]<span> (</span><span class='info'>Saint-Andre, P., “Multi-User Chat,” July 2007.</span><span>)</span></a> and publish-subscribe services as specified in <a class='info' href='#XEP-0060'>[XEP‑0060]<span> (</span><span class='info'>Millard, P., Saint-Andre, P., and R. Meijer, “Publish-Subscribe,” July 2010.</span><span>)</span></a>. | ||
1071 | </li> | ||
1072 | </ul><p> | ||
1073 | |||
1074 | </p> | ||
1075 | <a name="tcp"></a><br /><hr /> | ||
1076 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1077 | <a name="rfc.section.3"></a><h3>3. | ||
1078 | TCP Binding</h3> | ||
1079 | |||
1080 | <a name="tcp-scope"></a><br /><hr /> | ||
1081 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1082 | <a name="rfc.section.3.1"></a><h3>3.1. | ||
1083 | Scope</h3> | ||
1084 | |||
1085 | <p>As XMPP is defined in this specification, an initiating entity (client or server) MUST open a Transmission Control Protocol <a class='info' href='#TCP'>[TCP]<span> (</span><span class='info'>Postel, J., “Transmission Control Protocol,” September 1981.</span><span>)</span></a> connection to the receiving entity (server) before it negotiates XML streams with the receiving entity. The parties then maintain that TCP connection for as long as the XML streams are in use. The rules specified in the following sections apply to the TCP binding. | ||
1086 | </p> | ||
1087 | <p></p> | ||
1088 | <blockquote class="text"> | ||
1089 | <p>Informational Note: There is no necessary coupling of XML streams to TCP, and other transports are possible. For example, two entities could connect to each other by means of <a class='info' href='#HTTP'>[HTTP]<span> (</span><span class='info'>Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1,” June 1999.</span><span>)</span></a> as specified in <a class='info' href='#XEP-0124'>[XEP‑0124]<span> (</span><span class='info'>Paterson, I., Smith, D., and P. Saint-Andre, “Bidirectional-streams Over Synchronous HTTP (BOSH),” July 2010.</span><span>)</span></a> and <a class='info' href='#XEP-0206'>[XEP‑0206]<span> (</span><span class='info'>Paterson, I. and P. Saint-Andre, “XMPP Over BOSH,” July 2010.</span><span>)</span></a>. However, this specification defines only a binding of XMPP to TCP. | ||
1090 | </p> | ||
1091 | </blockquote> | ||
1092 | |||
1093 | <a name="tcp-resolution"></a><br /><hr /> | ||
1094 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1095 | <a name="rfc.section.3.2"></a><h3>3.2. | ||
1096 | Resolution of Fully Qualified Domain Names</h3> | ||
1097 | |||
1098 | <p>Because XML streams are sent over TCP, the initiating entity | ||
1099 | needs to determine the IPv4 or IPv6 address (and port) of the | ||
1100 | receiving entity before it can attempt to open an XML stream. | ||
1101 | Typically this is done by resolving the receiving entity's fully | ||
1102 | qualified domain name or FQDN (see <a class='info' href='#DNS-CONCEPTS'>[DNS‑CONCEPTS]<span> (</span><span class='info'>Mockapetris, P., “Domain names - concepts and facilities,” November 1987.</span><span>)</span></a>). | ||
1103 | </p> | ||
1104 | <a name="tcp-resolution-prefer"></a><br /><hr /> | ||
1105 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1106 | <a name="rfc.section.3.2.1"></a><h3>3.2.1. | ||
1107 | Preferred Process: SRV Lookup</h3> | ||
1108 | |||
1109 | <p>The preferred process for FQDN resolution is to use <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a> records as follows: | ||
1110 | </p> | ||
1111 | <p> | ||
1112 | </p> | ||
1113 | <ol class="text"> | ||
1114 | <li>The initiating entity constructs a DNS SRV query whose inputs are: | ||
1115 | |||
1116 | <ul class="text"> | ||
1117 | <li>a Service of "xmpp-client" (for client-to-server connections) or "xmpp-server" (for server-to-server connections) | ||
1118 | </li> | ||
1119 | <li>a Proto of "tcp" | ||
1120 | </li> | ||
1121 | <li>a Name corresponding to the "origin domain" <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> of the XMPP service to which the initiating entity wishes to connect (e.g., "example.net" or "im.example.com") | ||
1122 | </li> | ||
1123 | </ul> | ||
1124 | |||
1125 | </li> | ||
1126 | <li>The result is a query such as "_xmpp-client._tcp.example.net." or "_xmpp-server._tcp.im.example.com.". | ||
1127 | </li> | ||
1128 | <li> | ||
1129 | If a response is received, it will contain one or more combinations of a port and FDQN, each of which is weighted and prioritized as described in <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a>. | ||
1130 | |||
1131 | (However, if the result of the SRV lookup is a single resource record with a Target of ".", i.e., the root domain, then the initiating entity MUST abort SRV processing at this point because according to <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a> such a Target "means that the service is decidedly not available at this domain".) | ||
1132 | |||
1133 | </li> | ||
1134 | <li>The initiating entity chooses at least one of the returned FQDNs to resolve (following the rules in <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a>), which it does by performing DNS "A" or "AAAA" lookups on the FDQN; this will result in an IPv4 or IPv6 address. | ||
1135 | </li> | ||
1136 | <li>The initiating entity uses the IP address(es) from the successfully resolved FDQN (with the corresponding port number returned by the SRV lookup) as the connection address for the receiving entity. | ||
1137 | </li> | ||
1138 | <li>If the initiating entity fails to connect using that IP address but the "A" or "AAAA" lookups returned more than one IP address, then the initiating entity uses the next resolved IP address for that FDQN as the connection address. | ||
1139 | </li> | ||
1140 | <li>If the initiating entity fails to connect using all resolved IP addresses for a given FDQN, then it repeats the process of resolution and connection for the next FQDN returned by the SRV lookup based on the priority and weight as defined in <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a>. | ||
1141 | </li> | ||
1142 | <li>If the initiating entity receives a response to its SRV query but it is not able to establish an XMPP connection using the data received in the response, it SHOULD NOT attempt the fallback process described in the next section (this helps to prevent a state mismatch between inbound and outbound connections). | ||
1143 | </li> | ||
1144 | <li>If the initiating entity does not receive a response to its SRV query, it SHOULD attempt the fallback process described in the next section. | ||
1145 | </li> | ||
1146 | </ol><p> | ||
1147 | |||
1148 | </p> | ||
1149 | <a name="tcp-resolution-fallback"></a><br /><hr /> | ||
1150 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1151 | <a name="rfc.section.3.2.2"></a><h3>3.2.2. | ||
1152 | Fallback Processes</h3> | ||
1153 | |||
1154 | <p>The fallback process SHOULD be a normal "A" or "AAAA" address record resolution to determine the IPv4 or IPv6 address of the origin domain, where the port used is the "xmpp-client" port of 5222 for client-to-server connections or the "xmpp-server" port of 5269 for server-to-server connections (these are the default ports as registered with the IANA as described under <a class='info' href='#iana-ports'>Section 14.7<span> (</span><span class='info'>Port Numbers and Service Names</span><span>)</span></a>). | ||
1155 | </p> | ||
1156 | <p>If connections via TCP are unsuccessful, the initiating entity might attempt to find and use alternative connection methods such as the HTTP binding (see <a class='info' href='#XEP-0124'>[XEP‑0124]<span> (</span><span class='info'>Paterson, I., Smith, D., and P. Saint-Andre, “Bidirectional-streams Over Synchronous HTTP (BOSH),” July 2010.</span><span>)</span></a> and <a class='info' href='#XEP-0206'>[XEP‑0206]<span> (</span><span class='info'>Paterson, I. and P. Saint-Andre, “XMPP Over BOSH,” July 2010.</span><span>)</span></a>), which might be discovered using <a class='info' href='#DNS-TXT'>[DNS‑TXT]<span> (</span><span class='info'>Rosenbaum, R., “Using the Domain Name System To Store Arbitrary String Attributes,” May 1993.</span><span>)</span></a> records as described in <a class='info' href='#XEP-0156'>[XEP‑0156]<span> (</span><span class='info'>Hildebrand, J. and P. Saint-Andre, “Discovering Alternative XMPP Connection Methods,” June 2007.</span><span>)</span></a>. | ||
1157 | </p> | ||
1158 | <a name="tcp-resolution-srvnot"></a><br /><hr /> | ||
1159 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1160 | <a name="rfc.section.3.2.3"></a><h3>3.2.3. | ||
1161 | When Not to Use SRV</h3> | ||
1162 | |||
1163 | <p>If the initiating entity has been explicitly configured to associate a particular FQDN (and potentially port) with the origin domain of the receiving entity (say, to "hardcode" an association from an origin domain of example.net to a configured FQDN of apps.example.com), the initiating entity is encouraged to use the configured name instead of performing the preferred SRV resolution process on the origin domain. | ||
1164 | </p> | ||
1165 | <a name="tcp-resolution-srvadd"></a><br /><hr /> | ||
1166 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1167 | <a name="rfc.section.3.2.4"></a><h3>3.2.4. | ||
1168 | Use of SRV Records with Add-On Services</h3> | ||
1169 | |||
1170 | <p>Many XMPP servers are implemented in such a way that they can host add-on services (beyond those defined in this specification and <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>) at DNS domain names that typically are "subdomains" of the main XMPP service (e.g., conference.example.net for a <a class='info' href='#XEP-0045'>[XEP‑0045]<span> (</span><span class='info'>Saint-Andre, P., “Multi-User Chat,” July 2007.</span><span>)</span></a> service associated with the example.net XMPP service) or "subdomains" of the first-level domain of the underlying service (e.g., muc.example.com for a <a class='info' href='#XEP-0045'>[XEP‑0045]<span> (</span><span class='info'>Saint-Andre, P., “Multi-User Chat,” July 2007.</span><span>)</span></a> service associated with the im.example.com XMPP service). If an entity associated with a remote XMPP server wishes to communicate with such an add-on service, it would generate an appropriate XML stanza and the remote server would attempt to resolve the add-on service's DNS domain name via an SRV lookup on resource records such as "_xmpp-server._tcp.conference.example.net." or "_xmpp-server._tcp.muc.example.com.". Therefore, if the administrators of an XMPP service wish to enable entities associated with remote servers to access such add-on services, they need to advertise the appropriate "_xmpp-server" SRV records in addition to the "_xmpp-server" record for their main XMPP service. In case SRV records are not available, the fallback methods described under <a class='info' href='#tcp-resolution-fallback'>Section 3.2.2<span> (</span><span class='info'>Fallback Processes</span><span>)</span></a> can be used to resolve the DNS domain names of add-on services. | ||
1171 | </p> | ||
1172 | <a name="tcp-reconnect"></a><br /><hr /> | ||
1173 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1174 | <a name="rfc.section.3.3"></a><h3>3.3. | ||
1175 | Reconnection</h3> | ||
1176 | |||
1177 | <p>It can happen that an XMPP server goes offline unexpectedly while servicing TCP connections from connected clients and remote servers. Because the number of such connections can be quite large, the reconnection algorithm employed by entities that seek to reconnect can have a significant impact on software performance and network congestion. If an entity chooses to reconnect, it: | ||
1178 | </p> | ||
1179 | <p> | ||
1180 | </p> | ||
1181 | <ul class="text"> | ||
1182 | <li>SHOULD set the number of seconds that expire before reconnecting to an unpredictable number between 0 and 60 (this helps to ensure that not all entities attempt to reconnect at exactly the same number of seconds after being disconnected). | ||
1183 | </li> | ||
1184 | <li>SHOULD back off increasingly on the time between subsequent reconnection attempts (e.g., in accordance with "truncated binary exponential backoff" as described in <a class='info' href='#ETHERNET'>[ETHERNET]<span> (</span><span class='info'>, “Information technology - Telecommunications and information exchange between systems - Local and metropolitan area networks - Specific requirements - Part 3: Carrier sense multiple access with collision detection (CSMA/CD) access method and physical layer specifications,” September 1998.</span><span>)</span></a>) if the first reconnection attempt does not succeed. | ||
1185 | </li> | ||
1186 | </ul><p> | ||
1187 | |||
1188 | </p> | ||
1189 | <p>It is RECOMMENDED to make use of TLS session resumption <a class='info' href='#TLS-RESUME'>[TLS‑RESUME]<span> (</span><span class='info'>Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, “Transport Layer Security (TLS) Session Resumption without Server-Side State,” January 2008.</span><span>)</span></a> when reconnecting. A future version of this document, or a separate specification, might provide more detailed guidelines regarding methods for speeding the reconnection process. | ||
1190 | </p> | ||
1191 | <a name="streams-reliability"></a><br /><hr /> | ||
1192 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1193 | <a name="rfc.section.3.4"></a><h3>3.4. | ||
1194 | Reliability</h3> | ||
1195 | |||
1196 | <p>The use of long-lived TCP connections in XMPP implies that the sending of XML stanzas over XML streams can be unreliable, since the parties to a long-lived TCP connection might not discover a connectivity disruption in a timely manner. At the XMPP application layer, long connectivity disruptions can result in undelivered stanzas. Although the core XMPP technology defined in this specification does not contain features to overcome this lack of reliability, there exist XMPP extensions for doing so (e.g., <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a>). | ||
1197 | </p> | ||
1198 | <a name="streams"></a><br /><hr /> | ||
1199 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1200 | <a name="rfc.section.4"></a><h3>4. | ||
1201 | XML Streams</h3> | ||
1202 | |||
1203 | <a name="streams-fundamentals"></a><br /><hr /> | ||
1204 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1205 | <a name="rfc.section.4.1"></a><h3>4.1. | ||
1206 | Stream Fundamentals</h3> | ||
1207 | |||
1208 | <p>Two fundamental concepts make possible the rapid, asynchronous exchange of relatively small payloads of structured information between XMPP entities: XML streams and XML stanzas. These terms are defined as follows. | ||
1209 | </p> | ||
1210 | <p> | ||
1211 | </p> | ||
1212 | <blockquote class="text"><dl> | ||
1213 | <dt>Definition of XML Stream:</dt> | ||
1214 | <dd>An XML stream is a container for the exchange of XML elements between any two entities over a network. The start of an XML stream is denoted unambiguously by an opening "stream header" (i.e., an XML <stream> tag with appropriate attributes and namespace declarations), while the end of the XML stream is denoted unambiguously by a closing XML </stream> tag. During the life of the stream, the entity that initiated it can send an unbounded number of XML elements over the stream, either elements used to negotiate the stream (e.g., to complete <a class='info' href='#tls'>TLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> or <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>) or XML stanzas. The "initial stream" is negotiated from the initiating entity (typically a client or server) to the receiving entity (typically a server), and can be seen as corresponding to the initiating entity's "connection to" or "session with" the receiving entity. The initial stream enables unidirectional communication from the initiating entity to the receiving entity; in order to enable exchange of stanzas from the receiving entity to the initiating entity, the receiving entity MUST negotiate a stream in the opposite direction (the "response stream"). | ||
1215 | </dd> | ||
1216 | <dt>Definition of XML Stanza:</dt> | ||
1217 | <dd>An XML stanza is the basic unit of meaning in XMPP. A stanza is a first-level element (at depth=1 of the stream) whose element name is "message", "presence", or "iq" and whose qualifying namespace is 'jabber:client' or 'jabber:server'. By contrast, a first-level element qualified by any other namespace is not an XML stanza (stream errors, stream features, TLS-related elements, SASL-related elements, etc.), nor is a <message/>, <presence/>, or <iq/> element that is qualified by the 'jabber:client' or 'jabber:server' namespace but that occurs at a depth other than one (e.g., a <message/> element contained within an extension element (<a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a>) for reporting purposes), nor is a <message/>, <presence/>, or <iq/> element that is qualified by a namespace other than 'jabber:client' or 'jabber:server'. An XML stanza typically contains one or more child elements (with accompanying attributes, elements, and XML character data) as necessary in order to convey the desired information, which MAY be qualified by any XML namespace (see <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a> as well as <a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a> in this specification). | ||
1218 | </dd> | ||
1219 | </dl></blockquote><p> | ||
1220 | |||
1221 | </p> | ||
1222 | <p>There are three kinds of stanzas: message, presence, and IQ (short for | ||
1223 | "Info/Query"). These stanza types provide three different communication | ||
1224 | primitives: a "push" mechanism for generalized messaging, a specialized | ||
1225 | "publish-subscribe" mechanism for broadcasting information about network | ||
1226 | availability, and a "request-response" mechanism for more structured exchanges | ||
1227 | of data (similar to <a class='info' href='#HTTP'>[HTTP]<span> (</span><span class='info'>Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1,” June 1999.</span><span>)</span></a>). Further explanations are provided | ||
1228 | under Sections <a class='info' href='#stanzas-semantics-message'>8.2.1<span> (</span><span class='info'>Message Semantics</span><span>)</span></a>, | ||
1229 | <a class='info' href='#stanzas-semantics-presence'>8.2.2<span> (</span><span class='info'>Presence Semantics</span><span>)</span></a>, and <a class='info' href='#stanzas-semantics-iq'>8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>, respectively. | ||
1230 | </p> | ||
1231 | <p>Consider the example of a client's connection to a server. The client initiates an XML stream by sending a stream header to the server, preferably preceded by an XML declaration specifying the XML version and the character encoding supported (see <a class='info' href='#xml-declaration'>Section 11.5<span> (</span><span class='info'>Inclusion of XML Declaration</span><span>)</span></a> and <a class='info' href='#xml-encoding'>Section 11.6<span> (</span><span class='info'>Character Encoding</span><span>)</span></a>). Subject to local policies and service provisioning, the server then replies with a second XML stream back to the client, again preferably preceded by an XML declaration. Once the client has completed <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> and <a class='info' href='#bind'>resource binding<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>, the client can send an unbounded number of XML stanzas over the stream. When the client desires to close the stream, it simply sends a closing </stream> tag to the server as further described under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>. | ||
1232 | </p> | ||
1233 | <p>In essence, then, one XML stream functions as an envelope for the XML stanzas sent during a session and another XML stream functions as an envelope for the XML stanzas received during a session. We can represent this in a simplistic fashion as follows. | ||
1234 | </p><br /><hr class="insert" /> | ||
1235 | <a name="figure-2"></a> | ||
1236 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1237 | +--------------------+--------------------+ | ||
1238 | | INITIAL STREAM | RESPONSE STREAM | | ||
1239 | +--------------------+--------------------+ | ||
1240 | | <stream> | | | ||
1241 | |--------------------|--------------------| | ||
1242 | | | <stream> | | ||
1243 | |--------------------|--------------------| | ||
1244 | | <presence> | | | ||
1245 | | <show/> | | | ||
1246 | | </presence> | | | ||
1247 | |--------------------|--------------------| | ||
1248 | | <message to='foo'> | | | ||
1249 | | <body/> | | | ||
1250 | | </message> | | | ||
1251 | |--------------------|--------------------| | ||
1252 | | <iq to='bar' | | | ||
1253 | | type='get'> | | | ||
1254 | | <query/> | | | ||
1255 | | </iq> | | | ||
1256 | |--------------------|--------------------| | ||
1257 | | | <iq from='bar' | | ||
1258 | | | type='result'> | | ||
1259 | | | <query/> | | ||
1260 | | | </iq> | | ||
1261 | |--------------------|--------------------| | ||
1262 | | [ ... ] | | | ||
1263 | |--------------------|--------------------| | ||
1264 | | | [ ... ] | | ||
1265 | |--------------------|--------------------| | ||
1266 | | </stream> | | | ||
1267 | |--------------------|--------------------| | ||
1268 | | | </stream> | | ||
1269 | +--------------------+--------------------+ | ||
1270 | </pre></div><table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b> Figure 2: A Simplistic View of Two Streams </b></font><br /></td></tr></table><hr class="insert" /> | ||
1271 | |||
1272 | <p>Those who are accustomed to thinking of XML in a document-centric manner might find the following analogies useful: | ||
1273 | </p> | ||
1274 | <p> | ||
1275 | </p> | ||
1276 | <ul class="text"> | ||
1277 | <li>The two XML streams are like two "documents" (matching the "document" production from <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) that are built up through the accumulation of XML stanzas. | ||
1278 | </li> | ||
1279 | <li>The root <stream/> element is like the "document entity" for each "document" (as described in Section 4.8 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>). | ||
1280 | </li> | ||
1281 | <li>The XML stanzas sent over the streams are like "fragments" of the "documents" (as described in <a class='info' href='#XML-FRAG'>[XML‑FRAG]<span> (</span><span class='info'>Grosso, P. and D. Veillard, “XML Fragment Interchange,” February 2001.</span><span>)</span></a>). | ||
1282 | </li> | ||
1283 | </ul><p> | ||
1284 | |||
1285 | </p> | ||
1286 | <p>However, these descriptions are merely analogies, because XMPP does not deal in documents and fragments but in streams and stanzas. | ||
1287 | </p> | ||
1288 | <p>The remainder of this section defines the following aspects of XML streams (along with related topics): | ||
1289 | </p> | ||
1290 | <p> | ||
1291 | </p> | ||
1292 | <ul class="text"> | ||
1293 | <li>How to open a stream (<a class='info' href='#streams-open'>Section 4.2<span> (</span><span class='info'>Opening a Stream</span><span>)</span></a>) | ||
1294 | </li> | ||
1295 | <li>The stream negotiation process (<a class='info' href='#streams-negotiation'>Section 4.3<span> (</span><span class='info'>Stream Negotiation</span><span>)</span></a>) | ||
1296 | </li> | ||
1297 | <li>How to close a stream (<a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>) | ||
1298 | </li> | ||
1299 | <li>The directionality of XML streams (<a class='info' href='#streams-direction'>Section 4.5<span> (</span><span class='info'>Directionality</span><span>)</span></a>) | ||
1300 | </li> | ||
1301 | <li>How to handle peers that are silent (<a class='info' href='#streams-silence'>Section 4.6<span> (</span><span class='info'>Handling of Silent Peers</span><span>)</span></a>) | ||
1302 | </li> | ||
1303 | <li>The XML attributes of a stream (<a class='info' href='#streams-attr'>Section 4.7<span> (</span><span class='info'>Stream Attributes</span><span>)</span></a>) | ||
1304 | </li> | ||
1305 | <li>The XML namespaces of a stream (<a class='info' href='#streams-ns'>Section 4.8<span> (</span><span class='info'>XML Namespaces</span><span>)</span></a>) | ||
1306 | </li> | ||
1307 | <li>Error handling related to XML streams (<a class='info' href='#streams-error'>Section 4.9<span> (</span><span class='info'>Stream Errors</span><span>)</span></a>) | ||
1308 | </li> | ||
1309 | </ul><p> | ||
1310 | |||
1311 | </p> | ||
1312 | <a name="streams-open"></a><br /><hr /> | ||
1313 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1314 | <a name="rfc.section.4.2"></a><h3>4.2. | ||
1315 | Opening a Stream</h3> | ||
1316 | |||
1317 | <p>After connecting to the appropriate IP address and port of the receiving entity, the initiating entity opens a stream by sending a stream header (the "initial stream header") to the receiving entity. | ||
1318 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1319 | I: <?xml version='1.0'?> | ||
1320 | <stream:stream | ||
1321 | from='juliet@im.example.com' | ||
1322 | to='im.example.com' | ||
1323 | version='1.0' | ||
1324 | xml:lang='en' | ||
1325 | xmlns='jabber:client' | ||
1326 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1327 | </pre></div> | ||
1328 | <p>The receiving entity then replies by sending a stream header of its own (the "response stream header") to the initiating entity. | ||
1329 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1330 | R: <?xml version='1.0'?> | ||
1331 | <stream:stream | ||
1332 | from='im.example.com' | ||
1333 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
1334 | to='juliet@im.example.com' | ||
1335 | version='1.0' | ||
1336 | xml:lang='en' | ||
1337 | xmlns='jabber:client' | ||
1338 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1339 | </pre></div> | ||
1340 | <p>The entities can then proceed with the remainder of the stream negotiation process. | ||
1341 | </p> | ||
1342 | <a name="streams-negotiation"></a><br /><hr /> | ||
1343 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1344 | <a name="rfc.section.4.3"></a><h3>4.3. | ||
1345 | Stream Negotiation</h3> | ||
1346 | |||
1347 | <a name="streams-negotiation-basics"></a><br /><hr /> | ||
1348 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1349 | <a name="rfc.section.4.3.1"></a><h3>4.3.1. | ||
1350 | Basic Concepts</h3> | ||
1351 | |||
1352 | <p>Because the receiving entity for a stream acts as a gatekeeper to the domains it services, it imposes certain conditions for connecting as a client or as a peer server. At a minimum, the initiating entity needs to authenticate with the receiving entity before it is allowed to send stanzas to the receiving entity (for client-to-server streams this means using SASL as described under <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>). However, the receiving entity can consider conditions other than authentication to be mandatory-to-negotiate, such as encryption using TLS as described under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>. The receiving entity informs the initiating entity about such conditions by communicating "stream features": the set of particular protocol interactions that the initiating entity needs to complete before the receiving entity will accept XML stanzas from the initiating entity, as well as any protocol interactions that are voluntary-to-negotiate but that might improve the handling of an XML stream (e.g., establishment of application-layer compression as described in <a class='info' href='#XEP-0138'>[XEP‑0138]<span> (</span><span class='info'>Hildebrand, J. and P. Saint-Andre, “Stream Compression,” May 2009.</span><span>)</span></a>). | ||
1353 | </p> | ||
1354 | <p>The existence of conditions for connecting implies that | ||
1355 | streams need to be negotiated. The order of layers (TCP, then | ||
1356 | TLS, then SASL, then XMPP as described under | ||
1357 | <a class='info' href='#security-layers'>Section 13.3<span> (</span><span class='info'>Order of Layers</span><span>)</span></a>) implies that stream | ||
1358 | negotiation is a multi-stage process. Further structure is | ||
1359 | imposed by two factors: (1) a given stream feature might be | ||
1360 | offered only to certain entities or only after certain other | ||
1361 | features have been negotiated (e.g., resource binding is | ||
1362 | offered only after SASL authentication), and (2) stream | ||
1363 | features can be either mandatory-to-negotiate or | ||
1364 | voluntary-to-negotiate. Finally, for security reasons the | ||
1365 | parties to a stream need to discard knowledge that they gained | ||
1366 | during the negotiation process after successfully completing | ||
1367 | the protocol interactions defined for certain features (e.g., | ||
1368 | TLS in all cases and SASL in the case when a security layer | ||
1369 | might be established, as defined in the specification for the | ||
1370 | relevant SASL mechanism). This is done by flushing the old stream context and exchanging new stream headers over the existing TCP connection. | ||
1371 | </p> | ||
1372 | <a name="streams-negotiation-features"></a><br /><hr /> | ||
1373 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1374 | <a name="rfc.section.4.3.2"></a><h3>4.3.2. | ||
1375 | Stream Features Format</h3> | ||
1376 | |||
1377 | <p>If the initiating entity includes in the initial stream header the 'version' attribute set to a value of at least "1.0" (see <a class='info' href='#streams-attr-version'>Section 4.7.5<span> (</span><span class='info'>version</span><span>)</span></a>), after sending the response stream header the receiving entity MUST send a <features/> child element (typically prefixed by the stream namespace prefix as described under <a class='info' href='#streams-ns-declarations'>Section 4.8.5<span> (</span><span class='info'>Namespace Declarations and Prefixes</span><span>)</span></a>) to the initiating entity in order to announce any conditions for continuation of the stream negotiation process. Each condition takes the form of a child element of the <features/> element, qualified by a namespace that is different from the stream namespace and the content namespace. The <features/> element can contain one child, contain multiple children, or be empty. | ||
1378 | </p> | ||
1379 | <p></p> | ||
1380 | <blockquote class="text"> | ||
1381 | <p>Implementation Note: The order of child elements contained in any given <features/> element is not significant. | ||
1382 | </p> | ||
1383 | </blockquote> | ||
1384 | |||
1385 | <p>If a particular stream feature is or can be mandatory-to-negotiate, the definition of that feature needs to do one of the following: | ||
1386 | </p> | ||
1387 | <p> | ||
1388 | </p> | ||
1389 | <ol class="text"> | ||
1390 | <li>Declare that the feature is always mandatory-to-negotiate (e.g., this is true of resource binding for XMPP clients); or | ||
1391 | </li> | ||
1392 | <li>Specify a way for the receiving entity to flag the feature as mandatory-to-negotiate for this interaction (e.g., for STARTTLS, this is done by including an empty <required/> element in the advertisement for that stream feature, but that is not a generic format for all stream features); it is RECOMMENDED that stream feature definitions for new mandatory-to-negotiate features do so by including an empty <required/> element as is done for STARTTLS. | ||
1393 | </li> | ||
1394 | </ol><p> | ||
1395 | |||
1396 | </p> | ||
1397 | <p></p> | ||
1398 | <blockquote class="text"> | ||
1399 | <p>Informational Note: Because there is no generic format for indicating that a feature is mandatory-to-negotiate, it is possible that a feature that is not understood by the initiating entity might be considered mandatory-to-negotiate by the receiving entity, resulting in failure of the stream negotiation process. Although such an outcome would be undesirable, the working group deemed it rare enough that a generic format was not needed. | ||
1400 | </p> | ||
1401 | </blockquote> | ||
1402 | |||
1403 | <p>For security reasons, certain stream features necessitate the initiating entity to send a new initial stream header upon successful negotiation of the feature (e.g., TLS in all cases and SASL in the case when a security layer might be established). If this is true of a given stream feature, the definition of that feature needs to specify that a stream restart is expected after negotiation of the feature. | ||
1404 | </p> | ||
1405 | <p>A <features/> element that contains at least one mandatory-to-negotiate feature indicates that the stream negotiation is not complete and that the initiating entity MUST negotiate further features. | ||
1406 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1407 | R: <stream:features> | ||
1408 | <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> | ||
1409 | <required/> | ||
1410 | </starttls> | ||
1411 | </stream:features> | ||
1412 | </pre></div> | ||
1413 | <p>A <features/> element MAY contain more than one mandatory-to-negotiate feature. This means that the initiating entity can choose among the mandatory-to-negotiate features at this stage of the stream negotiation process. As an example, perhaps a future technology will perform roughly the same function as TLS, so the receiving entity might advertise support for both TLS and the future technology at the same stage of the stream negotiation process. However, this applies only at a given stage of the stream negotiation process and does not apply to features that are mandatory-to-negotiate at different stages (e.g., the receiving entity would not advertise both STARTTLS and SASL as mandatory-to-negotiate, or both SASL and resource binding as mandatory-to-negotiate, because TLS would need to be negotiated before SASL and because SASL would need to be negotiated before resource binding). | ||
1414 | </p> | ||
1415 | <p>A <features/> element that contains both mandatory-to-negotiate and voluntary-to-negotiate features indicates that the negotiation is not complete but that the initiating entity MAY complete the voluntary-to-negotiate feature(s) before it attempts to negotiate the mandatory-to-negotiate feature(s). | ||
1416 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1417 | R: <stream:features> | ||
1418 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> | ||
1419 | <compression xmlns='http://jabber.org/features/compress'> | ||
1420 | <method>zlib</method> | ||
1421 | <method>lzw</method> | ||
1422 | </compression> | ||
1423 | </stream:features> | ||
1424 | </pre></div> | ||
1425 | <p>A <features/> element that contains only voluntary-to-negotiate features indicates that the stream negotiation is complete and that the initiating entity is cleared to send XML stanzas, but that the initiating entity MAY negotiate further features if desired. | ||
1426 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1427 | R: <stream:features> | ||
1428 | <compression xmlns='http://jabber.org/features/compress'> | ||
1429 | <method>zlib</method> | ||
1430 | <method>lzw</method> | ||
1431 | </compression> | ||
1432 | </stream:features> | ||
1433 | </pre></div> | ||
1434 | <p>An empty <features/> element indicates that the stream negotiation is complete and that the initiating entity is cleared to send XML stanzas. | ||
1435 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1436 | R: <stream:features/> | ||
1437 | </pre></div> | ||
1438 | <a name="streams-negotiation-restart"></a><br /><hr /> | ||
1439 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1440 | <a name="rfc.section.4.3.3"></a><h3>4.3.3. | ||
1441 | Restarts</h3> | ||
1442 | |||
1443 | <p>On successful negotiation of a feature that necessitates a stream restart, both parties MUST consider the previous stream to be replaced but MUST NOT send a closing </stream> tag and MUST NOT terminate the underlying TCP connection; instead, the parties MUST reuse the existing connection, which might be in a new state (e.g., encrypted as a result of TLS negotiation). The initiating entity then MUST send a new initial stream header, which SHOULD be preceded by an XML declaration as described under <a class='info' href='#xml-declaration'>Section 11.5<span> (</span><span class='info'>Inclusion of XML Declaration</span><span>)</span></a>. When the receiving entity receives the new initial stream header, it MUST generate a new stream ID (instead of reusing the old stream ID) before sending a new response stream header (which SHOULD be preceded by an XML declaration as described under <a class='info' href='#xml-declaration'>Section 11.5<span> (</span><span class='info'>Inclusion of XML Declaration</span><span>)</span></a>). | ||
1444 | </p> | ||
1445 | <a name="streams-negotiation-resend"></a><br /><hr /> | ||
1446 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1447 | <a name="rfc.section.4.3.4"></a><h3>4.3.4. | ||
1448 | Resending Features</h3> | ||
1449 | |||
1450 | <p>The receiving entity MUST send an updated list of stream features to the initiating entity after a stream restart. The list of updated features MAY be empty if there are no further features to be advertised or MAY include any combination of features. | ||
1451 | </p> | ||
1452 | <a name="streams-negotiation-complete"></a><br /><hr /> | ||
1453 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1454 | <a name="rfc.section.4.3.5"></a><h3>4.3.5. | ||
1455 | Completion of Stream Negotiation</h3> | ||
1456 | |||
1457 | <p>The receiving entity indicates completion of the stream negotiation process by sending to the initiating entity either an empty <features/> element or a <features/> element that contains only voluntary-to-negotiate features. After doing so, the receiving entity MAY send an empty <features/> element (e.g., after negotiation of such voluntary-to-negotiate features) but MUST NOT send additional stream features to the initiating entity (if the receiving entity has new features to offer, preferably limited to mandatory-to-negotiate or security-critical features, it can simply close the stream with a <reset/> stream error (<a class='info' href='#streams-error-conditions-reset'>Section 4.9.3.16<span> (</span><span class='info'>reset</span><span>)</span></a>) and then advertise the new features when the initiating entity reconnects, preferably closing existing streams in a staggered way so that not all of the initiating entities reconnect at once). Once stream negotiation is complete, the initiating entity is cleared to send XML stanzas over the stream for as long as the stream is maintained by both parties. | ||
1458 | </p> | ||
1459 | <p></p> | ||
1460 | <blockquote class="text"> | ||
1461 | <p>Informational Note: Resource binding as specified under <a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a> is an historical exception to the foregoing rule, since it is mandatory-to-negotiate for clients but uses XML stanzas for negotiation purposes. | ||
1462 | </p> | ||
1463 | </blockquote> | ||
1464 | |||
1465 | <p>The initiating entity MUST NOT attempt to send <a class='info' href='#stanzas'>XML stanzas<span> (</span><span class='info'>XML Stanzas</span><span>)</span></a> to entities other than itself (i.e., the client's connected resource or any other authenticated resource of the client's account) or the server to which it is connected until stream negotiation has been completed. Even if the initiating entity does attempt to do so, the receiving entity MUST NOT accept such stanzas and MUST close the stream with a <not-authorized/> stream error (<a class='info' href='#streams-error-conditions-not-authorized'>Section 4.9.3.12<span> (</span><span class='info'>not-authorized</span><span>)</span></a>). This rule applies to XML stanzas only (i.e., <message/>, <presence/>, and <iq/> elements qualified by the content namespace) and not to XML elements used for stream negotiation (e.g., elements used to complete <a class='info' href='#tls'>TLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> or <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>). | ||
1466 | </p> | ||
1467 | <a name="streams-negotiation-address"></a><br /><hr /> | ||
1468 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1469 | <a name="rfc.section.4.3.6"></a><h3>4.3.6. | ||
1470 | Determination of Addresses</h3> | ||
1471 | |||
1472 | <p>After the parties to an XML stream have completed the appropriate aspects of stream negotiation, the receiving entity for a stream MUST determine the initiating entity's JID. | ||
1473 | </p> | ||
1474 | <p>For client-to-server communication, both <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> and <a class='info' href='#bind'>resource binding<span> (</span><span class='info'>Resource Binding</span><span>)</span></a> MUST be completed before the server can determine the client's address. The client's bare JID (<localpart@domainpart>) MUST be the authorization identity (as defined by <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>), either (1) as directly communicated by the client during <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> or (2) as derived by the server from the authentication identity if no authorization identity was specified during SASL negotiation. The resourcepart of the full JID (<localpart@domainpart/resourcepart>) MUST be the resource negotiated by the client and server during <a class='info' href='#bind'>resource binding<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>. A client MUST NOT attempt to guess at its JID but instead MUST consider its JID to be whatever the server returns to it during resource binding. The server MUST ensure that the resulting JID (including localpart, domainpart, resourcepart, and separator characters) conforms to the canonical format for XMPP addresses defined in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>; to meet this restriction, the server MAY replace the JID sent by the client with the canonicalized JID as determined by the server and communicate that JID to the client during resource binding. | ||
1475 | </p> | ||
1476 | <p>For server-to-server communication, the initiating server's bare JID (<domainpart>) MUST be the authorization identity (as defined by <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>), either (1) as directly communicated by the initiating server during <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> or (2) as derived by the receiving server from the authentication identity if no authorization identity was specified during SASL negotiation. In the absence of SASL negotiation, the receiving server MAY consider the authorization identity to be an identity negotiated within the relevant verification protocol (e.g., the 'from' attribute of the <result/> element in Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>). | ||
1477 | </p> | ||
1478 | <p></p> | ||
1479 | <blockquote class="text"> | ||
1480 | <p>Security Warning: Because it is possible for a third party to tamper with information that is sent over the stream before a security layer such as TLS is successfully negotiated, it is advisable for the receiving server to treat any such unprotected information with caution; this applies especially to the 'from' and 'to' addresses on the first initial stream header sent by the initiating entity. | ||
1481 | </p> | ||
1482 | </blockquote> | ||
1483 | |||
1484 | <a name="streams-negotiation-flowchart"></a><br /><hr /> | ||
1485 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1486 | <a name="rfc.section.4.3.7"></a><h3>4.3.7. | ||
1487 | Flow Chart</h3> | ||
1488 | |||
1489 | <p>We summarize the foregoing rules in the following non-normative flow chart for the stream negotiation process, presented from the perspective of the initiating entity. | ||
1490 | </p><br /><hr class="insert" /> | ||
1491 | <a name="figure-3"></a> | ||
1492 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1493 | +---------------------+ | ||
1494 | | open TCP connection | | ||
1495 | +---------------------+ | ||
1496 | | | ||
1497 | v | ||
1498 | +---------------+ | ||
1499 | | send initial |<-------------------------+ | ||
1500 | | stream header | ^ | ||
1501 | +---------------+ | | ||
1502 | | | | ||
1503 | v | | ||
1504 | +------------------+ | | ||
1505 | | receive response | | | ||
1506 | | stream header | | | ||
1507 | +------------------+ | | ||
1508 | | | | ||
1509 | v | | ||
1510 | +----------------+ | | ||
1511 | | receive stream | | | ||
1512 | +------------------>| features | | | ||
1513 | ^ {OPTIONAL} +----------------+ | | ||
1514 | | | | | ||
1515 | | v | | ||
1516 | | +<-----------------+ | | ||
1517 | | | | | ||
1518 | | {empty?} ----> {all voluntary?} ----> {some mandatory?} | | ||
1519 | | | no | no | | | ||
1520 | | | yes | yes | yes | | ||
1521 | | | v v | | ||
1522 | | | +---------------+ +----------------+ | | ||
1523 | | | | MAY negotiate | | MUST negotiate | | | ||
1524 | | | | any or none | | one feature | | | ||
1525 | | | +---------------+ +----------------+ | | ||
1526 | | v | | | | ||
1527 | | +---------+ v | | | ||
1528 | | | DONE |<----- {negotiate?} | | | ||
1529 | | +---------+ no | | | | ||
1530 | | yes | | | | ||
1531 | | v v | | ||
1532 | | +--------->+<---------+ | | ||
1533 | | | | | ||
1534 | | v | | ||
1535 | +<-------------------------- {restart mandatory?} ------------>+ | ||
1536 | no yes | ||
1537 | |||
1538 | </pre></div><table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b> Figure 3: Stream Negotiation Flow Chart </b></font><br /></td></tr></table><hr class="insert" /> | ||
1539 | |||
1540 | <a name="streams-close"></a><br /><hr /> | ||
1541 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1542 | <a name="rfc.section.4.4"></a><h3>4.4. | ||
1543 | Closing a Stream</h3> | ||
1544 | |||
1545 | <p>An XML stream from one entity to another can be closed at any time, either because a specific stream error (<a class='info' href='#streams-error'>Section 4.9<span> (</span><span class='info'>Stream Errors</span><span>)</span></a>) has occurred or in the absence of an error (e.g., when a client simply ends its session). | ||
1546 | </p> | ||
1547 | <p>A stream is closed by sending a closing </stream> tag. | ||
1548 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1549 | E: </stream:stream> | ||
1550 | </pre></div> | ||
1551 | <p>If the parties are using either two streams over a single TCP connection or two streams over two TCP connections, the entity that sends the closing stream tag MUST behave as follows: | ||
1552 | </p> | ||
1553 | <p> | ||
1554 | </p> | ||
1555 | <ol class="text"> | ||
1556 | <li>Wait for the other party to also close its outbound | ||
1557 | stream before terminating the underlying TCP connection(s); | ||
1558 | this gives the other party an opportunity to finish | ||
1559 | transmitting any outbound data to the closing entity before | ||
1560 | the termination of the TCP connection(s). | ||
1561 | </li> | ||
1562 | <li>Refrain from sending any further data over its outbound stream to the other entity, but continue to process data received from the other entity (and, if necessary, process such data). | ||
1563 | </li> | ||
1564 | <li>Consider both streams to be void if the other party does not send its closing stream tag within a reasonable amount of time (where the definition of "reasonable" is a matter of implementation or deployment). | ||
1565 | </li> | ||
1566 | <li>After receiving a reciprocal closing stream tag from the other party or waiting a reasonable amount of time with no response, terminate the underlying TCP connection(s). | ||
1567 | </li> | ||
1568 | </ol><p> | ||
1569 | |||
1570 | </p> | ||
1571 | <p></p> | ||
1572 | <blockquote class="text"> | ||
1573 | <p>Security Warning: In accordance with Section 7.2.1 of <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>, to help prevent a truncation attack the party that is closing the stream MUST send a TLS close_notify alert and MUST receive a responding close_notify alert from the other party before terminating the underlying TCP connection(s). | ||
1574 | </p> | ||
1575 | </blockquote> | ||
1576 | |||
1577 | <p>If the parties are using multiple streams over multiple TCP connections, there is no defined pairing of streams and therefore the behavior is a matter for implementation. | ||
1578 | </p> | ||
1579 | <a name="streams-direction"></a><br /><hr /> | ||
1580 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1581 | <a name="rfc.section.4.5"></a><h3>4.5. | ||
1582 | Directionality</h3> | ||
1583 | |||
1584 | <p>An XML stream is always unidirectional, by which is meant that XML stanzas can be sent in only one direction over the stream (either from the initiating entity to the receiving entity or from the receiving entity to the initiating entity). | ||
1585 | </p> | ||
1586 | <p>Depending on the type of session that has been negotiated and the nature of the entities involved, the entities might use: | ||
1587 | </p> | ||
1588 | <p> | ||
1589 | </p> | ||
1590 | <ul class="text"> | ||
1591 | <li>Two streams over a single TCP connection, where the security context negotiated for the first stream is applied to the second stream. This is typical for client-to-server sessions, and a server MUST allow a client to use the same TCP connection for both streams. | ||
1592 | </li> | ||
1593 | <li>Two streams over two TCP connections, where each stream is separately secured. In this approach, one TCP connection is used for the stream in which stanzas are sent from the initiating entity to the receiving entity, and the other TCP connection is used for the stream in which stanzas are sent from the receiving entity to the initiating entity. This is typical for server-to-server sessions. | ||
1594 | </li> | ||
1595 | <li>Multiple streams over two or more TCP connections, where each stream is separately secured. This approach is sometimes used for server-to-server communication between two large XMPP service providers; however, this can make it difficult to maintain coherence of data received over multiple streams in situations described under <a class='info' href='#rules-order'>Section 10.1<span> (</span><span class='info'>In-Order Processing</span><span>)</span></a>, which is why a server MAY close the stream with a <conflict/> stream error (<a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>) if a remote server attempts to negotiate more than one stream (as described under <a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>). | ||
1596 | </li> | ||
1597 | </ul><p> | ||
1598 | |||
1599 | </p> | ||
1600 | <p>This concept of directionality applies only to stanzas and explicitly does not apply to first-level children of the stream root that are used to bootstrap or manage the stream (e.g., first-level elements used for TLS negotiation, SASL negotiation, Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>, and Stream Management <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a>). | ||
1601 | </p> | ||
1602 | <p>The foregoing considerations imply that while completing <a class='info' href='#tls'>STARTTLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> and <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> two servers would use one TCP connection, but after the stream negotiation process is done that original TCP connection would be used only for the initiating server to send XML stanzas to the receiving server. In order for the receiving server to send XML stanzas to the initiating server, the receiving server would need to reverse the roles and negotiate an XML stream from the receiving server to the initiating server over a separate TCP connection. This separate TCP connection is then secured using a new round of TLS and/or SASL negotiation. | ||
1603 | </p> | ||
1604 | <p></p> | ||
1605 | <blockquote class="text"> | ||
1606 | <p>Implementation Note: For historical reasons, a server-to-server session always uses two TCP connections. While that approach remains the standard behavior described in this document, extensions such as <a class='info' href='#XEP-0288'>[XEP‑0288]<span> (</span><span class='info'>Hancke, P. and D. Cridland, “Bidirectional Server-to-Server Connections,” October 2010.</span><span>)</span></a> enable servers to negotiate the use of a single TCP connection for bidirectional stanza exchange. | ||
1607 | </p> | ||
1608 | </blockquote> | ||
1609 | |||
1610 | <p></p> | ||
1611 | <blockquote class="text"> | ||
1612 | <p>Informational Note: Although XMPP developers sometimes apply the terms "unidirectional" and "bidirectional" to the underlying TCP connection (e.g., calling the TCP connection for a client-to-server session "bidirectional" and the TCP connection for a server-to-server session "unidirectional"), strictly speaking a stream is always unidirectional (because the initiating entity and receiving entity always have a minimum of two streams, one in each direction) and a TCP connection is always bidirectional (because TCP traffic can be sent in both directions). Directionality applies to the application-layer traffic sent over the TCP connection, not to the transport-layer traffic sent over the TCP connection itself. | ||
1613 | </p> | ||
1614 | </blockquote> | ||
1615 | |||
1616 | <a name="streams-silence"></a><br /><hr /> | ||
1617 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1618 | <a name="rfc.section.4.6"></a><h3>4.6. | ||
1619 | Handling of Silent Peers</h3> | ||
1620 | |||
1621 | <p>When an entity that is a party to a stream has not received any XMPP traffic from its stream peer for some period of time, the peer might appear to be silent. There are several reasons why this might happen: | ||
1622 | </p> | ||
1623 | <p> | ||
1624 | </p> | ||
1625 | <ol class="text"> | ||
1626 | <li>The underlying TCP connection is dead. | ||
1627 | </li> | ||
1628 | <li>The XML stream is broken despite the fact that the underlying TCP connection is alive. | ||
1629 | </li> | ||
1630 | <li>The peer is idle and simply has not sent any XMPP traffic over its XML stream to the entity. | ||
1631 | </li> | ||
1632 | </ol><p> | ||
1633 | |||
1634 | </p> | ||
1635 | <p>These three conditions are best handled separately, as described in the following sections. | ||
1636 | </p> | ||
1637 | <p></p> | ||
1638 | <blockquote class="text"> | ||
1639 | <p>Implementation Note: For the purpose of handling silent peers, we treat a two unidirectional TCP connections as conceptually equivalent to a single bidirectional TCP connection (see <a class='info' href='#streams-direction'>Section 4.5<span> (</span><span class='info'>Directionality</span><span>)</span></a>); however, implementers need to be aware that, in the case of two unidirectional TCP connections, responses to traffic at the XMPP application layer will come back from the peer on the second TCP connection. In addition, the use of multiple streams in each direction (which is a somewhat frequent deployment choice for server-to-server connectivity among large XMPP service providers) further complicates application-level checking of XMPP streams and their underlying TCP connections, because there is no necessary correlation between any given initial stream and any given response stream. | ||
1640 | </p> | ||
1641 | </blockquote> | ||
1642 | |||
1643 | <a name="streams-silence-dead"></a><br /><hr /> | ||
1644 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1645 | <a name="rfc.section.4.6.1"></a><h3>4.6.1. | ||
1646 | Dead Connection</h3> | ||
1647 | |||
1648 | <p>If the underlying TCP connection is dead, stream-level checks (e.g., <a class='info' href='#XEP-0199'>[XEP‑0199]<span> (</span><span class='info'>Saint-Andre, P., “XMPP Ping,” June 2009.</span><span>)</span></a> and <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a>) are ineffective. Therefore, it is unnecessary to close the stream with or without an error, and it is appropriate instead to simply terminate the TCP connection. | ||
1649 | </p> | ||
1650 | <p>One common method for checking the TCP connection is to send a space character (U+0020) between XML stanzas, which is allowed for XML streams as described under <a class='info' href='#xml-whitespace'>Section 11.7<span> (</span><span class='info'>Whitespace</span><span>)</span></a>; the sending of such a space character is properly called a "whitespace keepalive" (the term "whitespace ping" is often used, despite the fact that it is not a ping since no "pong" is possible). However, this is not allowed during TLS negotiation or SASL negotiation, as described under <a class='info' href='#tls-rules-data'>Section 5.3.3<span> (</span><span class='info'>Data Formatting</span><span>)</span></a> and <a class='info' href='#sasl-rules-data'>Section 6.3.5<span> (</span><span class='info'>Data Formatting</span><span>)</span></a>. | ||
1651 | </p> | ||
1652 | <a name="streams-silence-broken"></a><br /><hr /> | ||
1653 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1654 | <a name="rfc.section.4.6.2"></a><h3>4.6.2. | ||
1655 | Broken Stream</h3> | ||
1656 | |||
1657 | <p>Even if the underlying TCP connection is alive, the peer might never respond to XMPP traffic that the entity sends, whether normal stanzas or specialized stream-checking traffic such as the application-level pings defined in <a class='info' href='#XEP-0199'>[XEP‑0199]<span> (</span><span class='info'>Saint-Andre, P., “XMPP Ping,” June 2009.</span><span>)</span></a> or the more comprehensive Stream Management protocol defined in <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a>. In this case, it is appropriate for the entity to close a broken stream with a <connection-timeout/> stream error (<a class='info' href='#streams-error-conditions-connection-timeout'>Section 4.9.3.4<span> (</span><span class='info'>connection-timeout</span><span>)</span></a>). | ||
1658 | </p> | ||
1659 | <a name="streams-silence-idle"></a><br /><hr /> | ||
1660 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1661 | <a name="rfc.section.4.6.3"></a><h3>4.6.3. | ||
1662 | Idle Peer</h3> | ||
1663 | |||
1664 | <p>Even if the underlying TCP connection is alive and the | ||
1665 | stream is not broken, the peer might have sent no stanzas for | ||
1666 | a certain period of time. In this case, the peer itself MAY | ||
1667 | close the stream (as described under | ||
1668 | <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>) rather than leaving an unused | ||
1669 | stream open. If the idle peer does not close the stream, the | ||
1670 | other party MAY either close the stream using the handshake | ||
1671 | described under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a> or close the | ||
1672 | stream with a stream error (e.g., <resource-constraint/> | ||
1673 | (<a class='info' href='#streams-error-conditions-resource-constraint'>Section 4.9.3.17<span> (</span><span class='info'>resource-constraint</span><span>)</span></a>) if | ||
1674 | the entity has reached a limit on the number of open TCP | ||
1675 | connections or <policy-violation/> | ||
1676 | (<a class='info' href='#streams-error-conditions-policy-violation'>Section 4.9.3.14<span> (</span><span class='info'>policy-violation</span><span>)</span></a>) | ||
1677 | if the connection has exceeded a local timeout policy). | ||
1678 | However, consistent with the order of layers (specified under | ||
1679 | <a class='info' href='#security-layers'>Section 13.3<span> (</span><span class='info'>Order of Layers</span><span>)</span></a>), the other party is advised | ||
1680 | to verify that the underlying TCP connection is alive and the | ||
1681 | stream is unbroken (as described above) before concluding that | ||
1682 | the peer is idle. Furthermore, it is preferable to be liberal | ||
1683 | in accepting idle peers, since experience has shown that doing | ||
1684 | so improves the reliability of communication over XMPP | ||
1685 | networks and that it is typically more efficient to maintain a | ||
1686 | stream between two servers than to aggressively time out such a stream. | ||
1687 | </p> | ||
1688 | <a name="streams-silence-check"></a><br /><hr /> | ||
1689 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1690 | <a name="rfc.section.4.6.4"></a><h3>4.6.4. | ||
1691 | Use of Checking Methods</h3> | ||
1692 | |||
1693 | <p>Implementers are advised to support whichever | ||
1694 | stream-checking and connection-checking methods they deem | ||
1695 | appropriate, but to carefully weigh the network impact of such | ||
1696 | methods against the benefits of discovering broken streams and | ||
1697 | dead TCP connections in a timely manner. The length of time | ||
1698 | between the use of any particular check is very much a matter | ||
1699 | of local service policy and depends strongly on the network | ||
1700 | environment and usage scenarios of a given deployment and | ||
1701 | connection type. At the time of writing, it is RECOMMENDED that any such check be performed not more than once every 5 minutes and that, ideally, such checks will be initiated by clients rather than servers. Those who implement XMPP software and deploy XMPP services are encouraged to seek additional advice regarding appropriate timing of stream-checking and connection-checking methods, particularly when power-constrained devices are being used (e.g., in mobile environments). | ||
1702 | </p> | ||
1703 | <a name="streams-attr"></a><br /><hr /> | ||
1704 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1705 | <a name="rfc.section.4.7"></a><h3>4.7. | ||
1706 | Stream Attributes</h3> | ||
1707 | |||
1708 | <p>The attributes of the root <stream/> element are defined in the following sections. | ||
1709 | </p> | ||
1710 | <p></p> | ||
1711 | <blockquote class="text"> | ||
1712 | <p>Security Warning: Until and unless the confidentiality and integrity of the stream are protected via TLS as described under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> or an equivalent security layer (such as the SASL GSSAPI mechanism), the attributes provided in a stream header could be tampered with by an attacker. | ||
1713 | </p> | ||
1714 | </blockquote> | ||
1715 | |||
1716 | <p></p> | ||
1717 | <blockquote class="text"> | ||
1718 | <p>Implementation Note: The attributes of the root <stream/> element are not prepended by a namespace prefix because, as explained in <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>, "[d]efault namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear." | ||
1719 | </p> | ||
1720 | </blockquote> | ||
1721 | |||
1722 | <a name="streams-attr-from"></a><br /><hr /> | ||
1723 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1724 | <a name="rfc.section.4.7.1"></a><h3>4.7.1. | ||
1725 | from</h3> | ||
1726 | |||
1727 | <p>The 'from' attribute specifies an XMPP identity of the entity sending the stream element. | ||
1728 | </p> | ||
1729 | <p>For initial stream headers in client-to-server communication, the 'from' attribute is the XMPP identity of the principal controlling the client, i.e., a JID of the form <localpart@domainpart>. The client might not know the XMPP identity, e.g., because the XMPP identity is assigned at a level other than the XMPP application layer (as in the Generic Security Service Application Program Interface <a class='info' href='#GSS-API'>[GSS‑API]<span> (</span><span class='info'>Linn, J., “Generic Security Service Application Program Interface Version 2, Update 1,” January 2000.</span><span>)</span></a>) or is derived by the server from information provided by the client (as in some deployments of end-user certificates with the SASL EXTERNAL mechanism). Furthermore, if the client considers the XMPP identity to be private information then it is advised not to include a 'from' attribute before the confidentiality and integrity of the stream are protected via TLS or an equivalent security layer. However, if the client knows the XMPP identity then it SHOULD include the 'from' attribute after the confidentiality and integrity of the stream are protected via TLS or an equivalent security layer. | ||
1730 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1731 | I: <?xml version='1.0'?> | ||
1732 | <stream:stream | ||
1733 | from='juliet@im.example.com' | ||
1734 | to='im.example.com' | ||
1735 | version='1.0' | ||
1736 | xml:lang='en' | ||
1737 | xmlns='jabber:client' | ||
1738 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1739 | </pre></div> | ||
1740 | <p>For initial stream headers in server-to-server communication, the 'from' attribute is one of the configured FQDNs of the server, i.e., a JID of the form <domainpart>. The initiating server might have more than one XMPP identity, e.g., in the case of a server that provides virtual hosting, so it will need to choose an identity that is associated with this output stream (e.g., based on the 'to' attribute of the stanza that triggered the stream negotiation attempt). Because a server is a "public entity" on the XMPP network, it MUST include the 'from' attribute after the confidentiality and integrity of the stream are protected via TLS or an equivalent security layer. | ||
1741 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1742 | I: <?xml version='1.0'?> | ||
1743 | <stream:stream | ||
1744 | from='example.net' | ||
1745 | to='im.example.com' | ||
1746 | version='1.0' | ||
1747 | xml:lang='en' | ||
1748 | xmlns='jabber:server' | ||
1749 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1750 | </pre></div> | ||
1751 | <p>For response stream headers in both client-to-server and server-to-server communication, the receiving entity MUST include the 'from' attribute and MUST set its value to one of the receiving entity's FQDNs (which MAY be an FQDN other than that specified in the 'to' attribute of the initial stream header, as described under <a class='info' href='#streams-error-rules-host'>Section 4.9.1.3<span> (</span><span class='info'>Stream Errors When the Host Is Unspecified or Unknown</span><span>)</span></a> and <a class='info' href='#streams-error-conditions-host-unknown'>Section 4.9.3.6<span> (</span><span class='info'>host-unknown</span><span>)</span></a>). | ||
1752 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1753 | R: <?xml version='1.0'?> | ||
1754 | <stream:stream | ||
1755 | from='im.example.com' | ||
1756 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
1757 | to='juliet@im.example.com' | ||
1758 | version='1.0' | ||
1759 | xml:lang='en' | ||
1760 | xmlns='jabber:client' | ||
1761 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1762 | </pre></div> | ||
1763 | <p>Whether or not the 'from' attribute is included, each entity MUST verify the identity of the other entity before exchanging XML stanzas with it, as described under <a class='info' href='#security-authentication'>Section 13.5<span> (</span><span class='info'>Peer Entity Authentication</span><span>)</span></a>. | ||
1764 | </p> | ||
1765 | <p></p> | ||
1766 | <blockquote class="text"> | ||
1767 | <p>Interoperability Note: It is possible that implementations based on <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a> will not include the 'from' address on any stream headers (even ones whose confidentiality and integrity are protected); an entity SHOULD be liberal in accepting such stream headers. | ||
1768 | </p> | ||
1769 | </blockquote> | ||
1770 | |||
1771 | <a name="streams-attr-to"></a><br /><hr /> | ||
1772 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1773 | <a name="rfc.section.4.7.2"></a><h3>4.7.2. | ||
1774 | to</h3> | ||
1775 | |||
1776 | <p>For initial stream headers in both client-to-server and server-to-server communication, the initiating entity MUST include the 'to' attribute and MUST set its value to a domainpart that the initiating entity knows or expects the receiving entity to service. (The same information can be provided in other ways, such as a Server Name Indication during TLS negotiation as described in <a class='info' href='#TLS-EXT'>[TLS‑EXT]<span> (</span><span class='info'>Eastlake 3rd, D., “Transport Layer Security (TLS) Extensions: Extension Definitions,” January 2011.</span><span>)</span></a>.) | ||
1777 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1778 | I: <?xml version='1.0'?> | ||
1779 | <stream:stream | ||
1780 | from='juliet@im.example.com' | ||
1781 | to='im.example.com' | ||
1782 | version='1.0' | ||
1783 | xml:lang='en' | ||
1784 | xmlns='jabber:client' | ||
1785 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1786 | </pre></div> | ||
1787 | <p>For response stream headers in client-to-server communication, if the client included a 'from' attribute in the initial stream header then the server MUST include a 'to' attribute in the response stream header and MUST set its value to the bare JID specified in the 'from' attribute of the initial stream header. If the client did not include a 'from' attribute in the initial stream header then the server MUST NOT include a 'to' attribute in the response stream header. | ||
1788 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1789 | R: <?xml version='1.0'?> | ||
1790 | <stream:stream | ||
1791 | from='im.example.com' | ||
1792 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
1793 | to='juliet@im.example.com' | ||
1794 | version='1.0' | ||
1795 | xml:lang='en' | ||
1796 | xmlns='jabber:client' | ||
1797 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1798 | </pre></div> | ||
1799 | <p>For response stream headers in server-to-server communication, the receiving entity MUST include a 'to' attribute in the response stream header and MUST set its value to the domainpart specified in the 'from' attribute of the initial stream header. | ||
1800 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1801 | R: <?xml version='1.0'?> | ||
1802 | <stream:stream | ||
1803 | from='im.example.com' | ||
1804 | id='g4qSvGvBxJ+xeAd7QKezOQJFFlw=' | ||
1805 | to='example.net' | ||
1806 | version='1.0' | ||
1807 | xml:lang='en' | ||
1808 | xmlns='jabber:server' | ||
1809 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1810 | </pre></div> | ||
1811 | <p>Whether or not the 'to' attribute is included, each entity MUST verify the identity of the other entity before exchanging XML stanzas with it, as described under <a class='info' href='#security-authentication'>Section 13.5<span> (</span><span class='info'>Peer Entity Authentication</span><span>)</span></a>. | ||
1812 | </p> | ||
1813 | <p></p> | ||
1814 | <blockquote class="text"> | ||
1815 | <p>Interoperability Note: It is possible that implementations based on <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a> will not include the 'to' address on stream headers; an entity SHOULD be liberal in accepting such stream headers. | ||
1816 | </p> | ||
1817 | </blockquote> | ||
1818 | |||
1819 | <a name="streams-attr-id"></a><br /><hr /> | ||
1820 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1821 | <a name="rfc.section.4.7.3"></a><h3>4.7.3. | ||
1822 | id</h3> | ||
1823 | |||
1824 | <p>The 'id' attribute specifies a unique identifier for the stream, called a "stream ID". The stream ID MUST be generated by the receiving entity when it sends a response stream header and MUST BE unique within the receiving application (normally a server). | ||
1825 | </p> | ||
1826 | <p></p> | ||
1827 | <blockquote class="text"> | ||
1828 | <p>Security Warning: The stream ID MUST be both unpredictable and non-repeating because it can be security-critical when reused by an authentication mechanisms, as is the case for Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a> and the "XMPP 0.9" authentication mechanism used before RFC 3920 defined the use of SASL in XMPP; for recommendations regarding randomness for security purposes, see <a class='info' href='#RANDOM'>[RANDOM]<span> (</span><span class='info'>Eastlake, D., Schiller, J., and S. Crocker, “Randomness Requirements for Security,” June 2005.</span><span>)</span></a>. | ||
1829 | </p> | ||
1830 | </blockquote> | ||
1831 | |||
1832 | <p>For initial stream headers, the initiating entity MUST NOT include the 'id' attribute; however, if the 'id' attribute is included, the receiving entity MUST ignore it. | ||
1833 | </p> | ||
1834 | <p>For response stream headers, the receiving entity MUST include the 'id' attribute. | ||
1835 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1836 | R: <?xml version='1.0'?> | ||
1837 | <stream:stream | ||
1838 | from='im.example.com' | ||
1839 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
1840 | to='juliet@im.example.com' | ||
1841 | version='1.0' | ||
1842 | xml:lang='en' | ||
1843 | xmlns='jabber:client' | ||
1844 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1845 | </pre></div> | ||
1846 | <p></p> | ||
1847 | <blockquote class="text"> | ||
1848 | <p>Interoperability Note: In RFC 3920, the text regarding inclusion of the 'id' attribute was ambiguous, leading some implementations to leave the attribute off the response stream header. | ||
1849 | </p> | ||
1850 | </blockquote> | ||
1851 | |||
1852 | <a name="streams-attr-xmllang"></a><br /><hr /> | ||
1853 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1854 | <a name="rfc.section.4.7.4"></a><h3>4.7.4. | ||
1855 | xml:lang</h3> | ||
1856 | |||
1857 | <p>The 'xml:lang' attribute specifies an entity's preferred or default language for any human-readable XML character data to be sent over the stream (an XML stanza can also possess an 'xml:lang' attribute, as discussed under <a class='info' href='#stanzas-attributes-lang'>Section 8.1.5<span> (</span><span class='info'>xml:lang</span><span>)</span></a>). The syntax of this attribute is defined in Section 2.12 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>; in particular, the value of the 'xml:lang' attribute MUST conform to the NMTOKEN datatype (as defined in Section 2.3 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) and MUST conform to the language identifier format defined in <a class='info' href='#LANGTAGS'>[LANGTAGS]<span> (</span><span class='info'>Phillips, A. and M. Davis, “Tags for Identifying Languages,” September 2009.</span><span>)</span></a>. | ||
1858 | </p> | ||
1859 | <p>For initial stream headers, the initiating entity SHOULD include the 'xml:lang' attribute. | ||
1860 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1861 | I: <?xml version='1.0'?> | ||
1862 | <stream:stream | ||
1863 | from='juliet@im.example.com' | ||
1864 | to='im.example.com' | ||
1865 | version='1.0' | ||
1866 | xml:lang='en' | ||
1867 | xmlns='jabber:client' | ||
1868 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1869 | </pre></div> | ||
1870 | <p>For response stream headers, the receiving entity MUST include the 'xml:lang' attribute. The following rules apply: | ||
1871 | </p> | ||
1872 | <p> | ||
1873 | </p> | ||
1874 | <ul class="text"> | ||
1875 | <li>If the initiating entity included an 'xml:lang' attribute in its initial stream header and the receiving entity supports that language in the human-readable XML character data that it generates and sends to the initiating entity (e.g., in the <text/> element for stream and stanza errors), the value of the 'xml:lang' attribute MUST be the identifier for the initiating entity's preferred language (e.g., "de-CH"). | ||
1876 | </li> | ||
1877 | <li>If the receiving entity supports a language that matches the initiating entity's preferred language according to the "lookup scheme" specified in Section 3.4 of <a class='info' href='#LANGMATCH'>[LANGMATCH]<span> (</span><span class='info'>Phillips, A. and M. Davis, “Matching of Language Tags,” September 2006.</span><span>)</span></a> (e.g., "de" instead of "de-CH"), then the value of the 'xml:lang' attribute SHOULD be the identifier for the matching language. | ||
1878 | </li> | ||
1879 | <li>If the receiving entity does not support the initiating entity's preferred language or a matching language according to the lookup scheme (or if the initiating entity did not include the 'xml:lang' attribute in its initial stream header), then the value of the 'xml:lang' attribute MUST be the identifier for the default language of the receiving entity (e.g., "en"). | ||
1880 | </li> | ||
1881 | </ul><p> | ||
1882 | |||
1883 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1884 | R: <?xml version='1.0'?> | ||
1885 | <stream:stream | ||
1886 | from='im.example.com' | ||
1887 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
1888 | to='juliet@im.example.com' | ||
1889 | version='1.0' | ||
1890 | xml:lang='en' | ||
1891 | xmlns='jabber:client' | ||
1892 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1893 | </pre></div> | ||
1894 | <p>If the initiating entity included the 'xml:lang' attribute in its initial stream header, the receiving entity SHOULD remember that value as the default xml:lang for all stanzas sent by the initiating entity over the current stream. As described under <a class='info' href='#stanzas-attributes-lang'>Section 8.1.5<span> (</span><span class='info'>xml:lang</span><span>)</span></a>, the initiating entity MAY include the 'xml:lang' attribute in any XML stanzas it sends over the stream. If the initiating entity does not include the 'xml:lang' attribute in any such stanza, the receiving entity SHOULD add the 'xml:lang' attribute to the stanza when routing it to a remote server or delivering it to a connected client, where the value of the attribute MUST be the identifier for the language preferred by the initiating entity (even if the receiving entity does not support that language for human-readable XML character data it generates and sends to the initiating entity, such as in stream or stanza errors). If the initiating entity includes the 'xml:lang' attribute in any such stanza, the receiving entity MUST NOT modify or delete it when routing it to a remote server or delivering it to a connected client. | ||
1895 | </p> | ||
1896 | <a name="streams-attr-version"></a><br /><hr /> | ||
1897 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1898 | <a name="rfc.section.4.7.5"></a><h3>4.7.5. | ||
1899 | version</h3> | ||
1900 | |||
1901 | <p>The inclusion of the version attribute set to a value of at least "1.0" signals support for the stream-related protocols defined in this specification, including <a class='info' href='#tls'>TLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>, <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>, <a class='info' href='#streams-negotiation-features'>stream features<span> (</span><span class='info'>Stream Features Format</span><span>)</span></a>, and <a class='info' href='#streams-error'>stream errors<span> (</span><span class='info'>Stream Errors</span><span>)</span></a>. | ||
1902 | </p> | ||
1903 | <p>The version of XMPP specified in this specification is "1.0"; in | ||
1904 | particular, XMPP 1.0 encapsulates the stream-related protocols as well as the | ||
1905 | basic semantics of the three defined XML stanza types (<message/>, | ||
1906 | <presence/>, and <iq/> as described under Sections <a class='info' href='#stanzas-semantics-message'>8.2.1<span> (</span><span class='info'>Message Semantics</span><span>)</span></a>, <a class='info' href='#stanzas-semantics-presence'>8.2.2<span> (</span><span class='info'>Presence Semantics</span><span>)</span></a>, and <a class='info' href='#stanzas-semantics-iq'>8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>, respectively). | ||
1907 | </p> | ||
1908 | <p>The numbering scheme for XMPP versions is "<major>.<minor>". The major and minor numbers MUST be treated as separate integers and each number MAY be incremented higher than a single digit. Thus, "XMPP 2.4" would be a lower version than "XMPP 2.13", which in turn would be lower than "XMPP 12.3". Leading zeros (e.g., "XMPP 6.01") MUST be ignored by recipients and MUST NOT be sent. | ||
1909 | </p> | ||
1910 | <p>The major version number will be incremented only if the stream and stanza formats or obligatory actions have changed so dramatically that an older version entity would not be able to interoperate with a newer version entity if it simply ignored the elements and attributes it did not understand and took the actions defined in the older specification. | ||
1911 | </p> | ||
1912 | <p>The minor version number will be incremented only if significant new capabilities have been added to the core protocol (e.g., a newly defined value of the 'type' attribute for message, presence, or IQ stanzas). The minor version number MUST be ignored by an entity with a smaller minor version number, but MAY be used for informational purposes by the entity with the larger minor version number (e.g., the entity with the larger minor version number would simply note that its correspondent would not be able to understand that value of the 'type' attribute and therefore would not send it). | ||
1913 | </p> | ||
1914 | <p>The following rules apply to the generation and handling of the 'version' attribute within stream headers: | ||
1915 | </p> | ||
1916 | <p> | ||
1917 | </p> | ||
1918 | <ol class="text"> | ||
1919 | <li>The initiating entity MUST set the value of the 'version' attribute in the initial stream header to the highest version number it supports (e.g., if the highest version number it supports is that defined in this specification, it MUST set the value to "1.0"). | ||
1920 | </li> | ||
1921 | <li>The receiving entity MUST set the value of the 'version' attribute in the response stream header to either the value supplied by the initiating entity or the highest version number supported by the receiving entity, whichever is lower. The receiving entity MUST perform a numeric comparison on the major and minor version numbers, not a string match on "<major>.<minor>". | ||
1922 | </li> | ||
1923 | <li>If the version number included in the response stream header is at least one major version lower than the version number included in the initial stream header and newer version entities cannot interoperate with older version entities as described, the initiating entity SHOULD close the stream with an <unsupported-version/> stream error (<a class='info' href='#streams-error-conditions-unsupported-version'>Section 4.9.3.25<span> (</span><span class='info'>unsupported-version</span><span>)</span></a>). | ||
1924 | </li> | ||
1925 | <li>If either entity receives a stream header with no 'version' attribute, the entity MUST consider the version supported by the other entity to be "0.9" and SHOULD NOT include a 'version' attribute in the response stream header. | ||
1926 | </li> | ||
1927 | </ol><p> | ||
1928 | |||
1929 | </p> | ||
1930 | <a name="streams-attr-summary"></a><br /><hr /> | ||
1931 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1932 | <a name="rfc.section.4.7.6"></a><h3>4.7.6. | ||
1933 | Summary of Stream Attributes</h3> | ||
1934 | |||
1935 | <p>The following table summarizes the attributes of the root <stream/> element. | ||
1936 | </p><br /><hr class="insert" /> | ||
1937 | <a name="figure-4"></a> | ||
1938 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1939 | +----------+--------------------------+-------------------------+ | ||
1940 | | | initiating to receiving | receiving to initiating | | ||
1941 | +----------+--------------------------+-------------------------+ | ||
1942 | | to | JID of receiver | JID of initiator | | ||
1943 | | from | JID of initiator | JID of receiver | | ||
1944 | | id | ignored | stream identifier | | ||
1945 | | xml:lang | default language | default language | | ||
1946 | | version | XMPP 1.0+ supported | XMPP 1.0+ supported | | ||
1947 | +----------+--------------------------+-------------------------+ | ||
1948 | </pre></div><table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b> Figure 4: Stream Attributes </b></font><br /></td></tr></table><hr class="insert" /> | ||
1949 | |||
1950 | <a name="streams-ns"></a><br /><hr /> | ||
1951 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1952 | <a name="rfc.section.4.8"></a><h3>4.8. | ||
1953 | XML Namespaces</h3> | ||
1954 | |||
1955 | <p>Readers are referred to the specification of XML namespaces <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a> for a full understanding of the concepts used in this section, especially the concept of a "default namespace" as provided in Section 3 and Section 6.2 of that specification. | ||
1956 | </p> | ||
1957 | <a name="streams-ns-stream"></a><br /><hr /> | ||
1958 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1959 | <a name="rfc.section.4.8.1"></a><h3>4.8.1. | ||
1960 | Stream Namespace</h3> | ||
1961 | |||
1962 | <p>The root <stream/> element ("stream header") MUST be qualified by the namespace 'http://etherx.jabber.org/streams' (the "stream namespace"). If this rule is violated, the entity that receives the offending stream header MUST close the stream with a stream error, which SHOULD be <invalid-namespace/> (<a class='info' href='#streams-error-conditions-invalid-namespace'>Section 4.9.3.10<span> (</span><span class='info'>invalid-namespace</span><span>)</span></a>), although some existing implementations send <bad-format/> (<a class='info' href='#streams-error-conditions-bad-format'>Section 4.9.3.1<span> (</span><span class='info'>bad-format</span><span>)</span></a>) instead. | ||
1963 | </p> | ||
1964 | <a name="streams-ns-content"></a><br /><hr /> | ||
1965 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
1966 | <a name="rfc.section.4.8.2"></a><h3>4.8.2. | ||
1967 | Content Namespace</h3> | ||
1968 | |||
1969 | <p>An entity MAY declare a "content namespace" as the default namespace for data sent over the stream (i.e., data other than elements qualified by the stream namespace). If so, (1) the content namespace MUST be other than the stream namespace, and (2) the content namespace MUST be the same for the initial stream and the response stream so that both streams are qualified consistently. The content namespace applies to all first-level child elements sent over the stream unless explicitly qualified by another namespace (i.e., the content namespace is the default namespace). | ||
1970 | </p> | ||
1971 | <p>Alternatively (i.e., instead of declaring the content namespace as the default namespace), an entity MAY explicitly qualify the namespace for each first-level child element of the stream, using so-called "prefix-free canonicalization". These two styles are shown in the following examples. | ||
1972 | </p> | ||
1973 | <p>When a content namespace is declared as the default namespace, in rough outline a stream will look something like the following. | ||
1974 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1975 | <stream:stream | ||
1976 | from='juliet@im.example.com' | ||
1977 | to='im.example.com' | ||
1978 | version='1.0' | ||
1979 | xml:lang='en' | ||
1980 | xmlns='jabber:client' | ||
1981 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
1982 | <message> | ||
1983 | <body>foo</body> | ||
1984 | </message> | ||
1985 | </stream:stream> | ||
1986 | </pre></div> | ||
1987 | <p>When a content namespace is not declared as the default namespace and so-called "prefix-free canonicalization" is used instead, in rough outline a stream will look something like the following. | ||
1988 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
1989 | <stream | ||
1990 | from='juliet@im.example.com' | ||
1991 | to='im.example.com' | ||
1992 | version='1.0' | ||
1993 | xml:lang='en' | ||
1994 | xmlns='http://etherx.jabber.org/streams'> | ||
1995 | <message xmlns='jabber:client'> | ||
1996 | <body>foo</body> | ||
1997 | </message> | ||
1998 | </stream> | ||
1999 | </pre></div> | ||
2000 | <p>Traditionally, most XMPP implementations have used the content-namespace-as-default-namespace style rather than the prefix-free canonicalization style for stream headers; however, both styles are acceptable since they are semantically equivalent. | ||
2001 | </p> | ||
2002 | <a name="streams-ns-xmpp"></a><br /><hr /> | ||
2003 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2004 | <a name="rfc.section.4.8.3"></a><h3>4.8.3. | ||
2005 | XMPP Content Namespaces</h3> | ||
2006 | |||
2007 | <p>XMPP as defined in this specification uses two content namespaces: 'jabber:client' and 'jabber:server'. These namespaces are nearly identical but are used in different contexts (client-to-server communication for 'jabber:client' and server-to-server communication for 'jabber:server'). The only difference between the two is that the 'to' and 'from' attributes are OPTIONAL on stanzas sent over XML streams qualified by the 'jabber:client' namespace, whereas they are REQUIRED on stanzas sent over XML streams qualified by the 'jabber:server' namespace. Support for these content namespaces implies support for the <a class='info' href='#stanzas-attributes'>common attributes<span> (</span><span class='info'>Common Attributes</span><span>)</span></a> and <a class='info' href='#stanzas-semantics'>basic semantics<span> (</span><span class='info'>Basic Semantics</span><span>)</span></a> of all three core stanza types (message, presence, and IQ). | ||
2008 | </p> | ||
2009 | <p>An implementation MAY support content namespaces other than 'jabber:client' or 'jabber:server'. However, because such namespaces would define applications other than XMPP, they are to be defined in separate specifications. | ||
2010 | </p> | ||
2011 | <p>An implementation MAY refuse to support any other content namespaces as default namespaces. If an entity receives a first-level child element qualified by a content namespace it does not support, it MUST close the stream with an <invalid-namespace/> stream error (<a class='info' href='#streams-error-conditions-invalid-namespace'>Section 4.9.3.10<span> (</span><span class='info'>invalid-namespace</span><span>)</span></a>). | ||
2012 | </p> | ||
2013 | <p>Client implementations MUST support the 'jabber:client' content namespace as a default namespace. The 'jabber:server' content namespace is out of scope for an XMPP client, and a client MUST NOT send stanzas qualified by the 'jabber:server' namespace. | ||
2014 | </p> | ||
2015 | <p>Server implementations MUST support as default content namespaces both the 'jabber:client' namespace (when the stream is used for communication between a client and a server) and the 'jabber:server' namespace (when the stream is used for communication between two servers). When communicating with a connected client, a server MUST NOT send stanzas qualified by the 'jabber:server' namespace; when communicating with a peer server, a server MUST NOT send stanzas qualified by the 'jabber:client' namespace. | ||
2016 | </p> | ||
2017 | <p></p> | ||
2018 | <blockquote class="text"> | ||
2019 | <p>Implementation Note: Because a client sends stanzas over a stream whose content namespace is 'jabber:client', if a server routes to a peer server a stanza it has received from a connected client then it needs to "re-scope" the stanza so that its content namespace is 'jabber:server'. Similarly, if a server delivers to a connected client a stanza it has received from a peer server then it needs to "re-scope" the stanza so that its content namespace is 'jabber:client'. This rule applies to XML stanzas as defined under <a class='info' href='#streams-fundamentals'>Section 4.1<span> (</span><span class='info'>Stream Fundamentals</span><span>)</span></a> (i.e., a first-level <message/>, <presence/>, or <iq/> element qualified by the 'jabber:client' or 'jabber:server' namespace), and by namespace inheritance to all child elements of a stanza. However, the rule does not apply to elements qualified by namespaces other than 'jabber:client' and 'jabber:server' nor to any children of such elements (e.g., a <message/> element contained within an extension element (<a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a>) for reporting purposes). Although it is not forbidden for an entity to generate stanzas in which an extension element contains a child element qualified by the 'jabber:client' or 'jabber:server' namespace, existing implementations handle such stanzas inconsistently; therefore, implementers are advised to weigh the likely lack of interoperability against the possible utility of such stanzas. Finally, servers are advised to apply stanza re-scoping to other stream connection methods and alternative XMPP connection methods, such as those specified in <a class='info' href='#XEP-0124'>[XEP‑0124]<span> (</span><span class='info'>Paterson, I., Smith, D., and P. Saint-Andre, “Bidirectional-streams Over Synchronous HTTP (BOSH),” July 2010.</span><span>)</span></a>, <a class='info' href='#XEP-0206'>[XEP‑0206]<span> (</span><span class='info'>Paterson, I. and P. Saint-Andre, “XMPP Over BOSH,” July 2010.</span><span>)</span></a>, <a class='info' href='#XEP-0114'>[XEP‑0114]<span> (</span><span class='info'>Saint-Andre, P., “Jabber Component Protocol,” March 2005.</span><span>)</span></a>, and <a class='info' href='#XEP-0225'>[XEP‑0225]<span> (</span><span class='info'>Saint-Andre, P., “Component Connections,” October 2008.</span><span>)</span></a>. | ||
2020 | </p> | ||
2021 | </blockquote> | ||
2022 | |||
2023 | <a name="streams-ns-other"></a><br /><hr /> | ||
2024 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2025 | <a name="rfc.section.4.8.4"></a><h3>4.8.4. | ||
2026 | Other Namespaces</h3> | ||
2027 | |||
2028 | <p>Either party to a stream MAY send data qualified by namespaces other than the content namespace and the stream namespace. For example, this is how data related to TLS negotiation and SASL negotiation are exchanged, as well as XMPP extensions such as Stream Management <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a> and Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>. | ||
2029 | </p> | ||
2030 | <p></p> | ||
2031 | <blockquote class="text"> | ||
2032 | <p>Interoperability Note: For historical reasons, some server implementations expect a declaration of the 'jabber:server:dialback' namespace on server-to-server streams, as explained in <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>. | ||
2033 | </p> | ||
2034 | </blockquote> | ||
2035 | |||
2036 | <p>However, an XMPP server MUST NOT route or deliver data received over an input stream if that data is (a) qualified by another namespace and (b) addressed to an entity other than the server, unless the other party to the output stream over which the server would send the data has explicitly negotiated or advertised support for receiving arbitrary data from the server. This rule is included because XMPP is designed for the exchange of XML stanzas (not arbitrary XML data), and because allowing an entity to send arbitrary data to other entities could significantly increase the potential for exchanging malicious information. As an example of this rule, the server hosting the example.net domain would not route the following first-level XML element from <romeo@example.net> to <juliet@example.com>: | ||
2037 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2038 | <ns1:foo xmlns:ns1='http://example.org/ns1' | ||
2039 | from='romeo@example.net/resource1' | ||
2040 | to='juliet@example.com'> | ||
2041 | <ns1:bar/> | ||
2042 | </ns1:foo> | ||
2043 | </pre></div> | ||
2044 | <p>This rule also applies to first-level elements that look like stanzas but that are improperly namespaced and therefore really are not stanzas at all (see also <a class='info' href='#streams-ns-declarations'>Section 4.8.5<span> (</span><span class='info'>Namespace Declarations and Prefixes</span><span>)</span></a>), for example: | ||
2045 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2046 | <ns2:message xmlns:ns2='http://example.org/ns2' | ||
2047 | from='romeo@example.net/resource1' | ||
2048 | to='juliet@example.com'> | ||
2049 | <body>hi</body> | ||
2050 | </ns2:message> | ||
2051 | </pre></div> | ||
2052 | <p>Upon receiving arbitrary first-level XML elements over an input stream, a server MUST either ignore the data or close the stream with a stream error, which SHOULD be <unsupported-stanza-type/> (<a class='info' href='#streams-error-conditions-unsupported-stanza-type'>Section 4.9.3.24<span> (</span><span class='info'>unsupported-stanza-type</span><span>)</span></a>). | ||
2053 | </p> | ||
2054 | <a name="streams-ns-declarations"></a><br /><hr /> | ||
2055 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2056 | <a name="rfc.section.4.8.5"></a><h3>4.8.5. | ||
2057 | Namespace Declarations and Prefixes</h3> | ||
2058 | |||
2059 | <p>Because the content namespace is other than the stream namespace, if a content namespace is declared as the default namespace then the following statements are true: | ||
2060 | </p> | ||
2061 | <p> | ||
2062 | </p> | ||
2063 | <ol class="text"> | ||
2064 | <li>The stream header needs to contain a namespace declaration for both the content namespace and the stream namespace. | ||
2065 | </li> | ||
2066 | <li>The stream namespace declaration needs to include a namespace prefix for the stream namespace. | ||
2067 | </li> | ||
2068 | </ol><p> | ||
2069 | |||
2070 | </p> | ||
2071 | <p></p> | ||
2072 | <blockquote class="text"> | ||
2073 | <p>Interoperability Note: For historical reasons, an implementation MAY accept only the prefix 'stream' for the stream namespace (resulting in prefixed names such as <stream:stream> and <stream:features>); this specification retains that allowance from <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a> for the purpose of backward compatibility. Implementations are advised that using a prefix other than 'stream' for the stream namespace might result in interoperability problems. If an entity receives a stream header with a stream namespace prefix it does not accept, it MUST close the stream with a stream error, which SHOULD be <bad-namespace-prefix/> (<a class='info' href='#streams-error-conditions-bad-namespace-prefix'>Section 4.9.3.2<span> (</span><span class='info'>bad-namespace-prefix</span><span>)</span></a>), although some existing implementations send <bad-format/> (<a class='info' href='#streams-error-conditions-bad-format'>Section 4.9.3.1<span> (</span><span class='info'>bad-format</span><span>)</span></a>) instead. | ||
2074 | </p> | ||
2075 | </blockquote> | ||
2076 | |||
2077 | <p>An implementation MUST NOT generate namespace prefixes for elements qualified by the content namespace (i.e., the default namespace for data sent over the stream) if the content namespace is 'jabber:client' or 'jabber:server'. For example, the following is illegal: | ||
2078 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2079 | <stream:stream | ||
2080 | from='juliet@im.example.com' | ||
2081 | to='im.example.com' | ||
2082 | version='1.0' | ||
2083 | xml:lang='en' | ||
2084 | xmlns='jabber:client' | ||
2085 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2086 | |||
2087 | <foo:message xmlns:foo='jabber:client'> | ||
2088 | <foo:body>foo</foo:body> | ||
2089 | </foo:message> | ||
2090 | </pre></div> | ||
2091 | <p>An XMPP entity SHOULD NOT accept data that violates this rule (in | ||
2092 | particular, an XMPP server MUST NOT route or deliver such data to another | ||
2093 | entity without first correcting the error); instead it SHOULD either ignore the data or close the stream with a stream error, which SHOULD be <bad-namespace-prefix/> (<a class='info' href='#streams-error-conditions-bad-namespace-prefix'>Section 4.9.3.2<span> (</span><span class='info'>bad-namespace-prefix</span><span>)</span></a>). | ||
2094 | </p> | ||
2095 | <p>Namespaces declared in a stream header MUST apply only to that stream (e.g., the 'jabber:server:dialback' namespace used in Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>). In particular, because XML stanzas intended for routing or delivery over streams with other entities will lose the namespace context declared in the header of the stream in which those stanzas originated, namespaces for extended content within such stanzas MUST NOT be declared in that stream header (see also <a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a>). If either party to a stream declares such namespaces, the other party to the stream SHOULD close the stream with an <invalid-namespace/> stream error (<a class='info' href='#streams-error-conditions-invalid-namespace'>Section 4.9.3.10<span> (</span><span class='info'>invalid-namespace</span><span>)</span></a>). In any case, an entity MUST ensure that such namespaces are properly declared (according to this section) when routing or delivering stanzas from an input stream to an output stream. | ||
2096 | </p> | ||
2097 | <a name="streams-error"></a><br /><hr /> | ||
2098 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2099 | <a name="rfc.section.4.9"></a><h3>4.9. | ||
2100 | Stream Errors</h3> | ||
2101 | |||
2102 | <p>The root stream element MAY contain an <error/> child element that is qualified by the stream namespace. The error child SHALL be sent by a compliant entity if it perceives that a stream-level error has occurred. | ||
2103 | </p> | ||
2104 | <a name="streams-error-rules"></a><br /><hr /> | ||
2105 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2106 | <a name="rfc.section.4.9.1"></a><h3>4.9.1. | ||
2107 | Rules</h3> | ||
2108 | |||
2109 | <p>The following rules apply to stream-level errors. | ||
2110 | </p> | ||
2111 | <a name="streams-error-rules-unrecoverable"></a><br /><hr /> | ||
2112 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2113 | <a name="rfc.section.4.9.1.1"></a><h3>4.9.1.1. | ||
2114 | Stream Errors Are Unrecoverable</h3> | ||
2115 | |||
2116 | <p>Stream-level errors are unrecoverable. Therefore, if an error occurs at the level of the stream, the entity that detects the error MUST send an <error/> element with an appropriate child element specifying the error condition and then immediately close the stream as described under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>. | ||
2117 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2118 | C: <message><body>No closing tag!</message> | ||
2119 | |||
2120 | S: <stream:error> | ||
2121 | <not-well-formed | ||
2122 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2123 | </stream:error> | ||
2124 | </stream:stream> | ||
2125 | </pre></div> | ||
2126 | <p>The entity that receives the stream error then SHALL close the stream as explained under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>. | ||
2127 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2128 | C: </stream:stream> | ||
2129 | </pre></div> | ||
2130 | <a name="streams-error-rules-setup"></a><br /><hr /> | ||
2131 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2132 | <a name="rfc.section.4.9.1.2"></a><h3>4.9.1.2. | ||
2133 | Stream Errors Can Occur During Setup</h3> | ||
2134 | |||
2135 | <p>If the error is triggered by the initial stream header, the receiving entity MUST still send the opening <stream> tag, include the <error/> element as a child of the stream element, and send the closing </stream> tag (preferably in the same TCP packet). | ||
2136 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2137 | C: <?xml version='1.0'?> | ||
2138 | <stream:stream | ||
2139 | from='juliet@im.example.com' | ||
2140 | to='im.example.com' | ||
2141 | version='1.0' | ||
2142 | xml:lang='en' | ||
2143 | xmlns='jabber:client' | ||
2144 | xmlns:stream='http://wrong.namespace.example.org/'> | ||
2145 | |||
2146 | S: <?xml version='1.0'?> | ||
2147 | <stream:stream | ||
2148 | from='im.example.com' | ||
2149 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2150 | to='juliet@im.example.com' | ||
2151 | version='1.0' | ||
2152 | xml:lang='en' | ||
2153 | xmlns='jabber:client' | ||
2154 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2155 | <stream:error> | ||
2156 | <invalid-namespace | ||
2157 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2158 | </stream:error> | ||
2159 | </stream:stream> | ||
2160 | </pre></div> | ||
2161 | <a name="streams-error-rules-host"></a><br /><hr /> | ||
2162 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2163 | <a name="rfc.section.4.9.1.3"></a><h3>4.9.1.3. | ||
2164 | Stream Errors When the Host Is Unspecified or Unknown</h3> | ||
2165 | |||
2166 | <p>If the initiating entity provides no 'to' attribute or provides an unknown host in the 'to' attribute and the error occurs during stream setup, the value of the 'from' attribute returned by the receiving entity in the stream header sent before closing the stream MUST be either an authoritative FQDN for the receiving entity or the empty string. | ||
2167 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2168 | C: <?xml version='1.0'?> | ||
2169 | <stream:stream | ||
2170 | from='juliet@im.example.com' | ||
2171 | to='unknown.host.example.com' | ||
2172 | version='1.0' | ||
2173 | xml:lang='en' | ||
2174 | xmlns='jabber:client' | ||
2175 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2176 | |||
2177 | S: <?xml version='1.0'?> | ||
2178 | <stream:stream | ||
2179 | from='im.example.com' | ||
2180 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2181 | to='juliet@im.example.com' | ||
2182 | version='1.0' | ||
2183 | xml:lang='en' | ||
2184 | xmlns='jabber:client' | ||
2185 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2186 | <stream:error> | ||
2187 | <host-unknown | ||
2188 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2189 | </stream:error> | ||
2190 | </stream:stream> | ||
2191 | </pre></div> | ||
2192 | <a name="streams-error-rules-where"></a><br /><hr /> | ||
2193 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2194 | <a name="rfc.section.4.9.1.4"></a><h3>4.9.1.4. | ||
2195 | Where Stream Errors Are Sent</h3> | ||
2196 | |||
2197 | <p>When two TCP connections are used between the initiating entity and the receiving entity (one in each direction) rather than using a single bidirectional connection, the following rules apply: | ||
2198 | </p> | ||
2199 | <p> | ||
2200 | </p> | ||
2201 | <ul class="text"> | ||
2202 | <li>Stream-level errors related to the initial stream are returned by the receiving entity on the response stream via the same TCP connection. | ||
2203 | </li> | ||
2204 | <li>Stanza errors triggered by outbound stanzas sent from the initiating entity over the initial stream via the same TCP connection are returned by the receiving entity on the response stream via the other ("return") TCP connection, since they are inbound stanzas from the perspective of the initiating entity. | ||
2205 | </li> | ||
2206 | </ul><p> | ||
2207 | |||
2208 | </p> | ||
2209 | <a name="streams-error-syntax"></a><br /><hr /> | ||
2210 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2211 | <a name="rfc.section.4.9.2"></a><h3>4.9.2. | ||
2212 | Syntax</h3> | ||
2213 | |||
2214 | <p>The syntax for stream errors is as follows, where XML data shown within the square brackets '[' and ']' is OPTIONAL. | ||
2215 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2216 | <stream:error> | ||
2217 | <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2218 | [<text xmlns='urn:ietf:params:xml:ns:xmpp-streams' | ||
2219 | xml:lang='langcode'> | ||
2220 | OPTIONAL descriptive text | ||
2221 | </text>] | ||
2222 | [OPTIONAL application-specific condition element] | ||
2223 | </stream:error> | ||
2224 | </pre></div> | ||
2225 | <p>The "defined-condition" MUST correspond to one of the stream error conditions defined under <a class='info' href='#streams-error-conditions'>Section 4.9.3<span> (</span><span class='info'>Defined Stream Error Conditions</span><span>)</span></a>. However, because additional error conditions might be defined in the future, if an entity receives a stream error condition that it does not understand then it MUST treat the unknown condition as equivalent to <undefined-condition/> (<a class='info' href='#streams-error-conditions-undefined-condition'>Section 4.9.3.21<span> (</span><span class='info'>undefined-condition</span><span>)</span></a>). If the designers of an XMPP protocol extension or the developers of an XMPP implementation need to communicate a stream error condition that is not defined in this specification, they can do so by defining an application-specific error condition element qualified by an application-specific namespace. | ||
2226 | </p> | ||
2227 | <p>The <error/> element: | ||
2228 | </p> | ||
2229 | <p></p> | ||
2230 | <ul class="text"> | ||
2231 | <li>MUST contain a child element corresponding to one of the <a class='info' href='#streams-error-conditions'>defined stream error conditions<span> (</span><span class='info'>Defined Stream Error Conditions</span><span>)</span></a>; this element MUST be qualified by the 'urn:ietf:params:xml:ns:xmpp-streams' namespace. | ||
2232 | </li> | ||
2233 | <li>MAY contain a <text/> child element containing XML character data that describes the error in more detail; this element MUST be qualified by the 'urn:ietf:params:xml:ns:xmpp-streams' namespace and SHOULD possess an 'xml:lang' attribute specifying the natural language of the XML character data. | ||
2234 | </li> | ||
2235 | <li>MAY contain a child element for an application-specific error condition; this element MUST be qualified by an application-defined namespace, and its structure is defined by that namespace (see <a class='info' href='#streams-error-app'>Section 4.9.4<span> (</span><span class='info'>Application-Specific Conditions</span><span>)</span></a>). | ||
2236 | </li> | ||
2237 | </ul> | ||
2238 | |||
2239 | <p>The <text/> element is OPTIONAL. If included, it MUST be used only to provide descriptive or diagnostic information that supplements the meaning of a defined condition or application-specific condition. It MUST NOT be interpreted programmatically by an application. It MUST NOT be used as the error message presented to a human user, but MAY be shown in addition to the error message associated with the defined condition element (and, optionally, the application-specific condition element). | ||
2240 | </p> | ||
2241 | <a name="streams-error-conditions"></a><br /><hr /> | ||
2242 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2243 | <a name="rfc.section.4.9.3"></a><h3>4.9.3. | ||
2244 | Defined Stream Error Conditions</h3> | ||
2245 | |||
2246 | <p>The following stream-level error conditions are defined. | ||
2247 | </p> | ||
2248 | <a name="streams-error-conditions-bad-format"></a><br /><hr /> | ||
2249 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2250 | <a name="rfc.section.4.9.3.1"></a><h3>4.9.3.1. | ||
2251 | bad-format</h3> | ||
2252 | |||
2253 | <p>The entity has sent XML that cannot be processed. | ||
2254 | </p> | ||
2255 | <p>(In the following example, the client sends an XMPP message that is not well-formed XML, which alternatively might trigger a <not-well-formed/> stream error (<a class='info' href='#streams-error-conditions-not-well-formed'>Section 4.9.3.13<span> (</span><span class='info'>not-well-formed</span><span>)</span></a>).) | ||
2256 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2257 | C: <message> | ||
2258 | <body>No closing tag! | ||
2259 | </message> | ||
2260 | |||
2261 | S: <stream:error> | ||
2262 | <bad-format | ||
2263 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2264 | </stream:error> | ||
2265 | </stream:stream> | ||
2266 | </pre></div> | ||
2267 | <p>This error can be used instead of the more specific XML-related errors, such as <bad-namespace-prefix/>, <invalid-xml/>, <not-well-formed/>, <restricted-xml/>, and <unsupported-encoding/>. However, the more specific errors are RECOMMENDED. | ||
2268 | </p> | ||
2269 | <a name="streams-error-conditions-bad-namespace-prefix"></a><br /><hr /> | ||
2270 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2271 | <a name="rfc.section.4.9.3.2"></a><h3>4.9.3.2. | ||
2272 | bad-namespace-prefix</h3> | ||
2273 | |||
2274 | <p>The entity has sent a namespace prefix that is unsupported, or has sent no namespace prefix on an element that needs such a prefix (see <a class='info' href='#xml-ns'>Section 11.2<span> (</span><span class='info'>XML Namespace Names and Prefixes</span><span>)</span></a>). | ||
2275 | </p> | ||
2276 | <p>(In the following example, the client specifies a namespace prefix of "foobar" for the XML stream namespace.) | ||
2277 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2278 | C: <?xml version='1.0'?> | ||
2279 | <foobar:stream | ||
2280 | from='juliet@im.example.com' | ||
2281 | to='im.example.com' | ||
2282 | version='1.0' | ||
2283 | xmlns='jabber:client' | ||
2284 | xmlns:foobar='http://etherx.jabber.org/streams'> | ||
2285 | |||
2286 | S: <?xml version='1.0'?> | ||
2287 | <stream:stream | ||
2288 | from='im.example.com' | ||
2289 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2290 | to='juliet@im.example.com' | ||
2291 | version='1.0' | ||
2292 | xml:lang='en' | ||
2293 | xmlns='jabber:client' | ||
2294 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2295 | <stream:error> | ||
2296 | <bad-namespace-prefix | ||
2297 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2298 | </stream:error> | ||
2299 | </stream:stream> | ||
2300 | </pre></div> | ||
2301 | <a name="streams-error-conditions-conflict"></a><br /><hr /> | ||
2302 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2303 | <a name="rfc.section.4.9.3.3"></a><h3>4.9.3.3. | ||
2304 | conflict</h3> | ||
2305 | |||
2306 | <p>The server either (1) is closing the existing stream for this entity because a new stream has been initiated that conflicts with the existing stream, or (2) is refusing a new stream for this entity because allowing the new stream would conflict with an existing stream (e.g., because the server allows only a certain number of connections from the same IP address or allows only one server-to-server stream for a given domain pair as a way of helping to ensure in-order processing as described under <a class='info' href='#rules-order'>Section 10.1<span> (</span><span class='info'>In-Order Processing</span><span>)</span></a>). | ||
2307 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2308 | C: <?xml version='1.0'?> | ||
2309 | <stream:stream | ||
2310 | from='juliet@im.example.com' | ||
2311 | to='im.example.com' | ||
2312 | version='1.0' | ||
2313 | xmlns='jabber:client' | ||
2314 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2315 | |||
2316 | S: <?xml version='1.0'?> | ||
2317 | <stream:stream | ||
2318 | from='im.example.com' | ||
2319 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2320 | to='juliet@im.example.com' | ||
2321 | version='1.0' | ||
2322 | xml:lang='en' | ||
2323 | xmlns='jabber:client' | ||
2324 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2325 | <stream:error> | ||
2326 | <conflict | ||
2327 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2328 | </stream:error> | ||
2329 | </stream:stream> | ||
2330 | </pre></div> | ||
2331 | <p>If a client receives a <conflict/> stream error (<a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>), during the resource binding aspect of its reconnection attempt it MUST NOT blindly request the resourcepart it used during the former session but instead MUST choose a different resourcepart; details are provided under <a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>. | ||
2332 | </p> | ||
2333 | <a name="streams-error-conditions-connection-timeout"></a><br /><hr /> | ||
2334 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2335 | <a name="rfc.section.4.9.3.4"></a><h3>4.9.3.4. | ||
2336 | connection-timeout</h3> | ||
2337 | |||
2338 | <p>One party is closing the stream because it has reason to believe that the other party has permanently lost the ability to communicate over the stream. The lack of ability to communicate can be discovered using various methods, such as whitespace keepalives as specified under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>, XMPP-level pings as defined in <a class='info' href='#XEP-0199'>[XEP‑0199]<span> (</span><span class='info'>Saint-Andre, P., “XMPP Ping,” June 2009.</span><span>)</span></a>, and XMPP Stream Management as defined in <a class='info' href='#XEP-0198'>[XEP‑0198]<span> (</span><span class='info'>Karneges, J., Hildebrand, J., Saint-Andre, P., Forno, F., Cridland, D., and M. Wild, “Stream Management,” February 2011.</span><span>)</span></a>. | ||
2339 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2340 | P: <stream:error> | ||
2341 | <connection-timeout | ||
2342 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2343 | </stream:error> | ||
2344 | </stream:stream> | ||
2345 | </pre></div> | ||
2346 | <p></p> | ||
2347 | <blockquote class="text"> | ||
2348 | <p>Interoperability Note: RFC 3920 specified that the <connection-timeout/> stream error (<a class='info' href='#streams-error-conditions-connection-timeout'>Section 4.9.3.4<span> (</span><span class='info'>connection-timeout</span><span>)</span></a>) is to be used if the peer has not generated any traffic over the stream for some period of time. That behavior is no longer recommended; instead, the error SHOULD be used only if the connected client or peer server has not responded to data sent over the stream. | ||
2349 | </p> | ||
2350 | </blockquote> | ||
2351 | |||
2352 | <a name="streams-error-conditions-host-gone"></a><br /><hr /> | ||
2353 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2354 | <a name="rfc.section.4.9.3.5"></a><h3>4.9.3.5. | ||
2355 | host-gone</h3> | ||
2356 | |||
2357 | <p>The value of the 'to' attribute provided in the initial stream header corresponds to an FQDN that is no longer serviced by the receiving entity. | ||
2358 | </p> | ||
2359 | <p>(In the following example, the peer specifies a 'to' address of "foo.im.example.com" when connecting to the "im.example.com" server, but the server no longer hosts a service at that address.) | ||
2360 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2361 | P: <?xml version='1.0'?> | ||
2362 | <stream:stream | ||
2363 | from='example.net' | ||
2364 | to='foo.im.example.com' | ||
2365 | version='1.0' | ||
2366 | xmlns='jabber:server' | ||
2367 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2368 | |||
2369 | S: <?xml version='1.0'?> | ||
2370 | <stream:stream | ||
2371 | from='im.example.com' | ||
2372 | id='g4qSvGvBxJ+xeAd7QKezOQJFFlw=' | ||
2373 | to='example.net' | ||
2374 | version='1.0' | ||
2375 | xml:lang='en' | ||
2376 | xmlns='jabber:server' | ||
2377 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2378 | <stream:error> | ||
2379 | <host-gone | ||
2380 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2381 | </stream:error> | ||
2382 | </stream:stream> | ||
2383 | </pre></div> | ||
2384 | <a name="streams-error-conditions-host-unknown"></a><br /><hr /> | ||
2385 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2386 | <a name="rfc.section.4.9.3.6"></a><h3>4.9.3.6. | ||
2387 | host-unknown</h3> | ||
2388 | |||
2389 | <p>The value of the 'to' attribute provided in the initial stream header does not correspond to an FQDN that is serviced by the receiving entity. | ||
2390 | </p> | ||
2391 | <p>(In the following example, the peer specifies a 'to' address of "example.org" when connecting to the "im.example.com" server, but the server knows nothing of that address.) | ||
2392 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2393 | P: <?xml version='1.0'?> | ||
2394 | <stream:stream | ||
2395 | from='example.net' | ||
2396 | to='example.org' | ||
2397 | version='1.0' | ||
2398 | xmlns='jabber:server' | ||
2399 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2400 | |||
2401 | S: <?xml version='1.0'?> | ||
2402 | <stream:stream | ||
2403 | from='im.example.com' | ||
2404 | id='g4qSvGvBxJ+xeAd7QKezOQJFFlw=' | ||
2405 | to='example.net' | ||
2406 | version='1.0' | ||
2407 | xml:lang='en' | ||
2408 | xmlns='jabber:server' | ||
2409 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2410 | <stream:error> | ||
2411 | <host-unknown | ||
2412 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2413 | </stream:error> | ||
2414 | </stream:stream> | ||
2415 | </pre></div> | ||
2416 | <a name="streams-error-conditions-improper-addressing"></a><br /><hr /> | ||
2417 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2418 | <a name="rfc.section.4.9.3.7"></a><h3>4.9.3.7. | ||
2419 | improper-addressing</h3> | ||
2420 | |||
2421 | <p>A stanza sent between two servers lacks a 'to' or 'from' attribute, the 'from' or 'to' attribute has no value, or the value violates the rules for XMPP addresses <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>. | ||
2422 | </p> | ||
2423 | <p>(In the following example, the peer sends a stanza without a 'to' address over a server-to-server stream.) | ||
2424 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2425 | P: <message from='juliet@im.example.com'> | ||
2426 | <body>Wherefore art thou?</body> | ||
2427 | </message> | ||
2428 | |||
2429 | S: <stream:error> | ||
2430 | <improper-addressing | ||
2431 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2432 | </stream:error> | ||
2433 | </stream:stream> | ||
2434 | </pre></div> | ||
2435 | <a name="streams-error-conditions-internal-server-error"></a><br /><hr /> | ||
2436 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2437 | <a name="rfc.section.4.9.3.8"></a><h3>4.9.3.8. | ||
2438 | internal-server-error</h3> | ||
2439 | |||
2440 | <p>The server has experienced a misconfiguration or other internal error that prevents it from servicing the stream. | ||
2441 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2442 | S: <stream:error> | ||
2443 | <internal-server-error | ||
2444 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2445 | </stream:error> | ||
2446 | </stream:stream> | ||
2447 | </pre></div> | ||
2448 | <a name="streams-error-conditions-invalid-from"></a><br /><hr /> | ||
2449 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2450 | <a name="rfc.section.4.9.3.9"></a><h3>4.9.3.9. | ||
2451 | invalid-from</h3> | ||
2452 | |||
2453 | <p>The data provided in a 'from' attribute does not match an authorized JID or validated domain as negotiated (1) between two servers using SASL or Server Dialback, or (2) between a client and a server via SASL authentication and resource binding. | ||
2454 | </p> | ||
2455 | <p>(In the following example, a peer that has authenticated only as "example.net" attempts to send a stanza from an address at "example.org".) | ||
2456 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2457 | P: <message from='romeo@example.org' to='juliet@im.example.com'> | ||
2458 | <body>Neither, fair saint, if either thee dislike.</body> | ||
2459 | </message> | ||
2460 | |||
2461 | S: <stream:error> | ||
2462 | <invalid-from | ||
2463 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2464 | </stream:error> | ||
2465 | </stream:stream> | ||
2466 | </pre></div> | ||
2467 | <a name="streams-error-conditions-invalid-namespace"></a><br /><hr /> | ||
2468 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2469 | <a name="rfc.section.4.9.3.10"></a><h3>4.9.3.10. | ||
2470 | invalid-namespace</h3> | ||
2471 | |||
2472 | <p>The stream namespace name is something other than "http://etherx.jabber.org/streams" (see <a class='info' href='#xml-ns'>Section 11.2<span> (</span><span class='info'>XML Namespace Names and Prefixes</span><span>)</span></a>) or the content namespace declared as the default namespace is not supported (e.g., something other than "jabber:client" or "jabber:server"). | ||
2473 | </p> | ||
2474 | <p>(In the following example, the client specifies a namespace of 'http://wrong.namespace.example.org/' for the stream.) | ||
2475 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2476 | C: <?xml version='1.0'?> | ||
2477 | <stream:stream | ||
2478 | from='juliet@im.example.com' | ||
2479 | to='im.example.com' | ||
2480 | version='1.0' | ||
2481 | xmlns='jabber:client' | ||
2482 | xmlns:stream='http://wrong.namespace.example.org/'> | ||
2483 | |||
2484 | S: <?xml version='1.0'?> | ||
2485 | <stream:stream | ||
2486 | from='im.example.com' | ||
2487 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2488 | to='juliet@im.example.com' | ||
2489 | version='1.0' | ||
2490 | xml:lang='en' | ||
2491 | xmlns='jabber:client' | ||
2492 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2493 | <stream:error> | ||
2494 | <invalid-namespace | ||
2495 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2496 | </stream:error> | ||
2497 | </stream:stream> | ||
2498 | </pre></div> | ||
2499 | <a name="streams-error-conditions-invalid-xml"></a><br /><hr /> | ||
2500 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2501 | <a name="rfc.section.4.9.3.11"></a><h3>4.9.3.11. | ||
2502 | invalid-xml</h3> | ||
2503 | |||
2504 | <p>The entity has sent invalid XML over the stream to a server that performs validation (see <a class='info' href='#xml-validation'>Section 11.4<span> (</span><span class='info'>Validation</span><span>)</span></a>). | ||
2505 | </p> | ||
2506 | <p>(In the following example, the peer attempts to send an IQ stanza of type "subscribe", but the XML schema defines no such value for the 'type' attribute.) | ||
2507 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2508 | P: <iq from='example.net' | ||
2509 | id='l3b1vs75' | ||
2510 | to='im.example.com' | ||
2511 | type='subscribe'> | ||
2512 | <ping xmlns='urn:xmpp:ping'/> | ||
2513 | </iq> | ||
2514 | |||
2515 | S: <stream:error> | ||
2516 | <invalid-xml | ||
2517 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2518 | </stream:error> | ||
2519 | </stream:stream> | ||
2520 | </pre></div> | ||
2521 | <a name="streams-error-conditions-not-authorized"></a><br /><hr /> | ||
2522 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2523 | <a name="rfc.section.4.9.3.12"></a><h3>4.9.3.12. | ||
2524 | not-authorized</h3> | ||
2525 | |||
2526 | <p>The entity has attempted to send XML stanzas or other outbound data before the stream has been authenticated, or otherwise is not authorized to perform an action related to stream negotiation; the receiving entity MUST NOT process the offending data before sending the stream error. | ||
2527 | </p> | ||
2528 | <p>(In the following example, the client attempts to send XML stanzas before authenticating with the server.) | ||
2529 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2530 | C: <?xml version='1.0'?> | ||
2531 | <stream:stream | ||
2532 | from='juliet@im.example.com' | ||
2533 | to='im.example.com' | ||
2534 | version='1.0' | ||
2535 | xmlns='jabber:client' | ||
2536 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2537 | |||
2538 | S: <?xml version='1.0'?> | ||
2539 | <stream:stream | ||
2540 | from='im.example.com' | ||
2541 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2542 | to='juliet@im.example.com' | ||
2543 | version='1.0' | ||
2544 | xml:lang='en' | ||
2545 | xmlns='jabber:client' | ||
2546 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2547 | |||
2548 | C: <message to='romeo@example.net'> | ||
2549 | <body>Wherefore art thou?</body> | ||
2550 | </message> | ||
2551 | |||
2552 | S: <stream:error> | ||
2553 | <not-authorized | ||
2554 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2555 | </stream:error> | ||
2556 | </stream:stream> | ||
2557 | </pre></div> | ||
2558 | <a name="streams-error-conditions-not-well-formed"></a><br /><hr /> | ||
2559 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2560 | <a name="rfc.section.4.9.3.13"></a><h3>4.9.3.13. | ||
2561 | not-well-formed</h3> | ||
2562 | |||
2563 | <p>The initiating entity has sent XML that violates the well-formedness rules of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> or <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>. | ||
2564 | </p> | ||
2565 | <p>(In the following example, the client sends an XMPP message that is not namespace-well-formed.) | ||
2566 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2567 | C: <message> | ||
2568 | <foo:body>What is this foo?</foo:body> | ||
2569 | </message> | ||
2570 | |||
2571 | S: <stream:error> | ||
2572 | <not-well-formed | ||
2573 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2574 | </stream:error> | ||
2575 | </stream:stream> | ||
2576 | </pre></div> | ||
2577 | <p></p> | ||
2578 | <blockquote class="text"> | ||
2579 | <p>Interoperability Note: In RFC 3920, the name of this error condition was "xml-not-well-formed" instead of "not-well-formed". The name was changed because the element name <xml-not-well-formed/> violates the constraint from Section 3 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> that "names beginning with a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization in this or future versions of this specification". | ||
2580 | </p> | ||
2581 | </blockquote> | ||
2582 | |||
2583 | <a name="streams-error-conditions-policy-violation"></a><br /><hr /> | ||
2584 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2585 | <a name="rfc.section.4.9.3.14"></a><h3>4.9.3.14. | ||
2586 | policy-violation</h3> | ||
2587 | |||
2588 | <p>The entity has violated some local service policy (e.g., a stanza exceeds a configured size limit); the server MAY choose to specify the policy in the <text/> element or in an application-specific condition element. | ||
2589 | </p> | ||
2590 | <p>(In the following example, the client sends an XMPP message that is too large according to the server's local service policy.) | ||
2591 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2592 | C: <message to='juliet@im.example.com' id='foo'> | ||
2593 | <body>[ ... the-emacs-manual ... ]</body> | ||
2594 | </message> | ||
2595 | |||
2596 | S: <stream:error> | ||
2597 | <policy-violation | ||
2598 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2599 | <stanza-too-big xmlns='urn:xmpp:errors'/> | ||
2600 | </stream:error> | ||
2601 | |||
2602 | S: </stream:stream> | ||
2603 | </pre></div> | ||
2604 | <a name="streams-error-conditions-remote-connection-failed"></a><br /><hr /> | ||
2605 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2606 | <a name="rfc.section.4.9.3.15"></a><h3>4.9.3.15. | ||
2607 | remote-connection-failed</h3> | ||
2608 | |||
2609 | <p>The server is unable to properly connect to a remote entity that is needed for authentication or authorization (e.g., in certain scenarios related to Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>); this condition is not to be used when the cause of the error is within the administrative domain of the XMPP service provider, in which case the <internal-server-error/> condition is more appropriate. | ||
2610 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2611 | C: <?xml version='1.0'?> | ||
2612 | <stream:stream | ||
2613 | from='juliet@im.example.com' | ||
2614 | to='im.example.com' | ||
2615 | version='1.0' | ||
2616 | xmlns='jabber:client' | ||
2617 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2618 | |||
2619 | S: <?xml version='1.0'?> | ||
2620 | <stream:stream | ||
2621 | from='im.example.com' | ||
2622 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2623 | to='juliet@im.example.com' | ||
2624 | version='1.0' | ||
2625 | xml:lang='en' | ||
2626 | xmlns='jabber:client' | ||
2627 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2628 | <stream:error> | ||
2629 | <remote-connection-failed | ||
2630 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2631 | </stream:error> | ||
2632 | </stream:stream> | ||
2633 | </pre></div> | ||
2634 | <a name="streams-error-conditions-reset"></a><br /><hr /> | ||
2635 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2636 | <a name="rfc.section.4.9.3.16"></a><h3>4.9.3.16. | ||
2637 | reset</h3> | ||
2638 | |||
2639 | <p>The server is closing the stream because it has new (typically security-critical) features to offer, because the keys or certificates used to establish a secure context for the stream have expired or have been revoked during the life of the stream (<a class='info' href='#security-certificates-validation-streams'>Section 13.7.2.3<span> (</span><span class='info'>Checking of Certificates in Long-Lived Streams</span><span>)</span></a>), because the TLS sequence number has wrapped (<a class='info' href='#tls-rules-renegotiation'>Section 5.3.5<span> (</span><span class='info'>TLS Renegotiation</span><span>)</span></a>), etc. The reset applies to the stream and to any security context established for that stream (e.g., via TLS and SASL), which means that encryption and authentication need to be negotiated again for the new stream (e.g., TLS session resumption cannot be used). | ||
2640 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2641 | S: <stream:error> | ||
2642 | <reset | ||
2643 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2644 | </stream:error> | ||
2645 | </stream:stream> | ||
2646 | </pre></div> | ||
2647 | <a name="streams-error-conditions-resource-constraint"></a><br /><hr /> | ||
2648 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2649 | <a name="rfc.section.4.9.3.17"></a><h3>4.9.3.17. | ||
2650 | resource-constraint</h3> | ||
2651 | |||
2652 | <p>The server lacks the system resources necessary to service the stream. | ||
2653 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2654 | C: <?xml version='1.0'?> | ||
2655 | <stream:stream | ||
2656 | from='juliet@im.example.com' | ||
2657 | to='im.example.com' | ||
2658 | version='1.0' | ||
2659 | xmlns='jabber:client' | ||
2660 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2661 | |||
2662 | S: <?xml version='1.0'?> | ||
2663 | <stream:stream | ||
2664 | from='im.example.com' | ||
2665 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2666 | to='juliet@im.example.com' | ||
2667 | version='1.0' | ||
2668 | xml:lang='en' | ||
2669 | xmlns='jabber:client' | ||
2670 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2671 | <stream:error> | ||
2672 | <resource-constraint | ||
2673 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2674 | </stream:error> | ||
2675 | </stream:stream> | ||
2676 | </pre></div> | ||
2677 | <a name="streams-error-conditions-restricted-xml"></a><br /><hr /> | ||
2678 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2679 | <a name="rfc.section.4.9.3.18"></a><h3>4.9.3.18. | ||
2680 | restricted-xml</h3> | ||
2681 | |||
2682 | <p>The entity has attempted to send restricted XML features such as a comment, processing instruction, DTD subset, or XML entity reference (see <a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a>). | ||
2683 | </p> | ||
2684 | <p>(In the following example, the client sends an XMPP message containing an XML comment.) | ||
2685 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2686 | C: <message to='juliet@im.example.com'> | ||
2687 | <!--<subject/>--> | ||
2688 | <body>This message has no subject.</body> | ||
2689 | </message> | ||
2690 | |||
2691 | S: <stream:error> | ||
2692 | <restricted-xml | ||
2693 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2694 | </stream:error> | ||
2695 | </stream:stream> | ||
2696 | </pre></div> | ||
2697 | <a name="streams-error-conditions-see-other-host"></a><br /><hr /> | ||
2698 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2699 | <a name="rfc.section.4.9.3.19"></a><h3>4.9.3.19. | ||
2700 | see-other-host</h3> | ||
2701 | |||
2702 | <p>The server will not provide service to the initiating entity but is redirecting traffic to another host under the administrative control of the same service provider. The XML character data of the <see-other-host/> element returned by the server MUST specify the alternate FQDN or IP address at which to connect, which MUST be a valid domainpart or a domainpart plus port number (separated by the ':' character in the form "domainpart:port"). If the domainpart is the same as the source domain, derived domain, or resolved IPv4 or IPv6 address to which the initiating entity originally connected (differing only by the port number), then the initiating entity SHOULD simply attempt to reconnect at that address. (The format of an IPv6 address MUST follow <a class='info' href='#IPv6-ADDR'>[IPv6‑ADDR]<span> (</span><span class='info'>Kawamura, S. and M. Kawashima, “A Recommendation for IPv6 Address Text Representation,” August 2010.</span><span>)</span></a>, which includes the enclosing the IPv6 address in square brackets '[' and ']' as originally defined by <a class='info' href='#URI'>[URI]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a>.) Otherwise, the initiating entity MUST resolve the FQDN specified in the <see-other-host/> element as described under <a class='info' href='#tcp-resolution'>Section 3.2<span> (</span><span class='info'>Resolution of Fully Qualified Domain Names</span><span>)</span></a>. | ||
2703 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2704 | C: <?xml version='1.0'?> | ||
2705 | <stream:stream | ||
2706 | from='juliet@im.example.com' | ||
2707 | to='im.example.com' | ||
2708 | version='1.0' | ||
2709 | xmlns='jabber:client' | ||
2710 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2711 | |||
2712 | S: <?xml version='1.0'?> | ||
2713 | <stream:stream | ||
2714 | from='im.example.com' | ||
2715 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2716 | to='juliet@im.example.com' | ||
2717 | version='1.0' | ||
2718 | xml:lang='en' | ||
2719 | xmlns='jabber:client' | ||
2720 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2721 | <stream:error> | ||
2722 | <see-other-host | ||
2723 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'> | ||
2724 | [2001:41D0:1:A49b::1]:9222 | ||
2725 | </see-other-host> | ||
2726 | </stream:error> | ||
2727 | </stream:stream> | ||
2728 | </pre></div> | ||
2729 | <p>When negotiating a stream with the host to which it has been redirected, the initiating entity MUST apply the same policies it would have applied to the original connection attempt (e.g., a policy requiring TLS), MUST specify the same 'to' address on the initial stream header, and MUST verify the identity of the new host using the same reference identifier(s) it would have used for the original connection attempt (in accordance with <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a>). Even if the receiving entity returns a <see-other-host/> error before the confidentiality and integrity of the stream have been established (thus introducing the possibility of a denial-of-service attack), the fact that the initiating entity needs to verify the identity of the XMPP service based on the same reference identifiers implies that the initiating entity will not connect to a malicious entity. To reduce the possibility of a denial-of-service attack, (a) the receiving entity SHOULD NOT close the stream with a <see-other-host/> stream error until after the confidentiality and integrity of the stream have been protected via TLS or an equivalent security layer (such as the SASL GSSAPI mechanism), and (b) the receiving entity MAY have a policy of following redirects only if it has authenticated the receiving entity. In addition, the initiating entity SHOULD abort the connection attempt after a certain number of successive redirects (e.g., at least 2 but no more than 5). | ||
2730 | </p> | ||
2731 | <a name="streams-error-conditions-system-shutdown"></a><br /><hr /> | ||
2732 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2733 | <a name="rfc.section.4.9.3.20"></a><h3>4.9.3.20. | ||
2734 | system-shutdown</h3> | ||
2735 | |||
2736 | <p>The server is being shut down and all active streams are being closed. | ||
2737 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2738 | S: <stream:error> | ||
2739 | <system-shutdown | ||
2740 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2741 | </stream:error> | ||
2742 | </stream:stream> | ||
2743 | </pre></div> | ||
2744 | <a name="streams-error-conditions-undefined-condition"></a><br /><hr /> | ||
2745 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2746 | <a name="rfc.section.4.9.3.21"></a><h3>4.9.3.21. | ||
2747 | undefined-condition</h3> | ||
2748 | |||
2749 | <p>The error condition is not one of those defined by the other conditions in this list; this error condition SHOULD NOT be used except in conjunction with an application-specific condition. | ||
2750 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2751 | S: <stream:error> | ||
2752 | <undefined-condition | ||
2753 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2754 | <app-error xmlns='http://example.org/ns'/> | ||
2755 | </stream:error> | ||
2756 | </stream:stream> | ||
2757 | </pre></div> | ||
2758 | <a name="streams-error-conditions-unsupported-encoding"></a><br /><hr /> | ||
2759 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2760 | <a name="rfc.section.4.9.3.22"></a><h3>4.9.3.22. | ||
2761 | unsupported-encoding</h3> | ||
2762 | |||
2763 | <p>The initiating entity has encoded the stream in an encoding that is not supported by the server (see <a class='info' href='#xml-encoding'>Section 11.6<span> (</span><span class='info'>Character Encoding</span><span>)</span></a>) or has otherwise improperly encoded the stream (e.g., by violating the rules of the <a class='info' href='#UTF-8'>[UTF‑8]<span> (</span><span class='info'>Yergeau, F., “UTF-8, a transformation format of ISO 10646,” November 2003.</span><span>)</span></a> encoding). | ||
2764 | </p> | ||
2765 | <p>(In the following example, the client attempts to encode data using UTF-16 instead of UTF-8.) | ||
2766 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2767 | C: <?xml version='1.0' encoding='UTF-16'?> | ||
2768 | <stream:stream | ||
2769 | from='juliet@im.example.com' | ||
2770 | to='im.example.com' | ||
2771 | version='1.0' | ||
2772 | xmlns='jabber:client' | ||
2773 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2774 | |||
2775 | S: <?xml version='1.0'?> | ||
2776 | <stream:stream | ||
2777 | from='im.example.com' | ||
2778 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2779 | to='juliet@im.example.com' | ||
2780 | version='1.0' | ||
2781 | xml:lang='en' | ||
2782 | xmlns='jabber:client' | ||
2783 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2784 | <stream:error> | ||
2785 | <unsupported-encoding | ||
2786 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2787 | </stream:error> | ||
2788 | </stream:stream> | ||
2789 | </pre></div> | ||
2790 | <a name="streams-error-conditions-unsupported-feature"></a><br /><hr /> | ||
2791 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2792 | <a name="rfc.section.4.9.3.23"></a><h3>4.9.3.23. | ||
2793 | unsupported-feature</h3> | ||
2794 | |||
2795 | <p>The receiving entity has advertised a mandatory-to-negotiate stream feature that the initiating entity does not support, and has offered no other mandatory-to-negotiate feature alongside the unsupported feature. | ||
2796 | </p> | ||
2797 | <p>(In the following example, the receiving entity requires negotiation of an example feature, but the initiating entity does not support the feature.) | ||
2798 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2799 | R: <stream:features> | ||
2800 | <example xmlns='urn:xmpp:example'> | ||
2801 | <required/> | ||
2802 | </example> | ||
2803 | </stream:features> | ||
2804 | |||
2805 | I: <stream:error> | ||
2806 | <unsupported-feature | ||
2807 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2808 | </stream:error> | ||
2809 | </stream:stream> | ||
2810 | </pre></div> | ||
2811 | <a name="streams-error-conditions-unsupported-stanza-type"></a><br /><hr /> | ||
2812 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2813 | <a name="rfc.section.4.9.3.24"></a><h3>4.9.3.24. | ||
2814 | unsupported-stanza-type</h3> | ||
2815 | |||
2816 | <p>The initiating entity has sent a first-level child of the stream that is not supported by the server, either because the receiving entity does not understand the namespace or because the receiving entity does not understand the element name for the applicable namespace (which might be the content namespace declared as the default namespace). | ||
2817 | </p> | ||
2818 | <p>(In the following example, the client attempts to send a first-level child element of <pubsub/> qualified by the 'jabber:client' namespace, but the schema for that namespace defines no such element.) | ||
2819 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2820 | C: <pubsub xmlns='jabber:client'> | ||
2821 | <publish node='princely_musings'> | ||
2822 | <item id='ae890ac52d0df67ed7cfdf51b644e901'> | ||
2823 | <entry xmlns='http://www.w3.org/2005/Atom'> | ||
2824 | <title>Soliloquy</title> | ||
2825 | <summary> | ||
2826 | To be, or not to be: that is the question: | ||
2827 | Whether 'tis nobler in the mind to suffer | ||
2828 | The slings and arrows of outrageous fortune, | ||
2829 | Or to take arms against a sea of troubles, | ||
2830 | And by opposing end them? | ||
2831 | </summary> | ||
2832 | <link rel='alternate' type='text/html' | ||
2833 | href='http://denmark.example/2003/12/13/atom03'/> | ||
2834 | <id>tag:denmark.example,2003:entry-32397</id> | ||
2835 | <published>2003-12-13T18:30:02Z</published> | ||
2836 | <updated>2003-12-13T18:30:02Z</updated> | ||
2837 | </entry> | ||
2838 | </item> | ||
2839 | </publish> | ||
2840 | </pubsub> | ||
2841 | |||
2842 | S: <stream:error> | ||
2843 | <unsupported-stanza-type | ||
2844 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2845 | </stream:error> | ||
2846 | </stream:stream> | ||
2847 | </pre></div> | ||
2848 | <a name="streams-error-conditions-unsupported-version"></a><br /><hr /> | ||
2849 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2850 | <a name="rfc.section.4.9.3.25"></a><h3>4.9.3.25. | ||
2851 | unsupported-version</h3> | ||
2852 | |||
2853 | <p>The 'version' attribute provided by the initiating entity in the stream header specifies a version of XMPP that is not supported by the server. | ||
2854 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2855 | C: <?xml version='1.0'?> | ||
2856 | <stream:stream | ||
2857 | from='juliet@im.example.com' | ||
2858 | to='im.example.com' | ||
2859 | version='11.0' | ||
2860 | xmlns='jabber:client' | ||
2861 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2862 | |||
2863 | S: <?xml version='1.0'?> | ||
2864 | <stream:stream | ||
2865 | from='im.example.com' | ||
2866 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2867 | to='juliet@im.example.com' | ||
2868 | version='1.0' | ||
2869 | xml:lang='en' | ||
2870 | xmlns='jabber:client' | ||
2871 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2872 | <stream:error> | ||
2873 | <unsupported-version | ||
2874 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2875 | </stream:error> | ||
2876 | </stream:stream> | ||
2877 | </pre></div> | ||
2878 | <a name="streams-error-app"></a><br /><hr /> | ||
2879 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2880 | <a name="rfc.section.4.9.4"></a><h3>4.9.4. | ||
2881 | Application-Specific Conditions</h3> | ||
2882 | |||
2883 | <p>As noted, an application MAY provide application-specific | ||
2884 | stream error information by including a properly namespaced child in the error element. The application-specific element SHOULD supplement or further qualify a defined element. Thus, the <error/> element will contain two or three child elements. | ||
2885 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2886 | C: <message> | ||
2887 | <body> | ||
2888 | My keyboard layout is: | ||
2889 | |||
2890 | QWERTYUIOP{}| | ||
2891 | ASDFGHJKL:" | ||
2892 | ZXCVBNM<>? | ||
2893 | </body> | ||
2894 | </message> | ||
2895 | |||
2896 | S: <stream:error> | ||
2897 | <not-well-formed | ||
2898 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2899 | <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'> | ||
2900 | Some special application diagnostic information! | ||
2901 | </text> | ||
2902 | <escape-your-data xmlns='http://example.org/ns'/> | ||
2903 | </stream:error> | ||
2904 | </stream:stream> | ||
2905 | </pre></div> | ||
2906 | <a name="streams-example"></a><br /><hr /> | ||
2907 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2908 | <a name="rfc.section.4.10"></a><h3>4.10. | ||
2909 | Simplified Stream Examples</h3> | ||
2910 | |||
2911 | <p>This section contains two highly simplified examples of a stream-based connection between a client and a server; these examples are included for the purpose of illustrating the concepts introduced thus far, but the reader needs to be aware that these examples elide many details (see <a class='info' href='#examples'>Section 9<span> (</span><span class='info'>Detailed Examples</span><span>)</span></a> for more complete examples). | ||
2912 | </p> | ||
2913 | <p>A basic connection: | ||
2914 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2915 | C: <?xml version='1.0'?> | ||
2916 | <stream:stream | ||
2917 | from='juliet@im.example.com' | ||
2918 | to='im.example.com' | ||
2919 | version='1.0' | ||
2920 | xml:lang='en' | ||
2921 | xmlns='jabber:client' | ||
2922 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2923 | |||
2924 | S: <?xml version='1.0'?> | ||
2925 | <stream:stream | ||
2926 | from='im.example.com' | ||
2927 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2928 | to='juliet@im.example.com' | ||
2929 | version='1.0' | ||
2930 | xml:lang='en' | ||
2931 | xmlns='jabber:client' | ||
2932 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2933 | |||
2934 | [ ... stream negotiation ... ] | ||
2935 | |||
2936 | C: <message from='juliet@im.example.com/balcony' | ||
2937 | to='romeo@example.net' | ||
2938 | xml:lang='en'> | ||
2939 | <body>Art thou not Romeo, and a Montague?</body> | ||
2940 | </message> | ||
2941 | |||
2942 | S: <message from='romeo@example.net/orchard' | ||
2943 | to='juliet@im.example.com/balcony' | ||
2944 | xml:lang='en'> | ||
2945 | <body>Neither, fair saint, if either thee dislike.</body> | ||
2946 | </message> | ||
2947 | |||
2948 | C: </stream:stream> | ||
2949 | |||
2950 | S: </stream:stream> | ||
2951 | </pre></div> | ||
2952 | <p>A connection gone bad: | ||
2953 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
2954 | C: <?xml version='1.0'?> | ||
2955 | <stream:stream | ||
2956 | from='juliet@im.example.com' | ||
2957 | to='im.example.com' | ||
2958 | version='1.0' | ||
2959 | xml:lang='en' | ||
2960 | xmlns='jabber:client' | ||
2961 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2962 | |||
2963 | S: <?xml version='1.0'?> | ||
2964 | <stream:stream | ||
2965 | from='im.example.com' | ||
2966 | id='++TR84Sm6A3hnt3Q065SnAbbk3Y=' | ||
2967 | to='juliet@im.example.com' | ||
2968 | version='1.0' | ||
2969 | xml:lang='en' | ||
2970 | xmlns='jabber:client' | ||
2971 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
2972 | |||
2973 | [ ... stream negotiation ... ] | ||
2974 | |||
2975 | C: <message from='juliet@im.example.com/balcony' | ||
2976 | to='romeo@example.net' | ||
2977 | xml:lang='en'> | ||
2978 | <body>No closing tag! | ||
2979 | </message> | ||
2980 | |||
2981 | S: <stream:error> | ||
2982 | <not-well-formed | ||
2983 | xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
2984 | </stream:error> | ||
2985 | </stream:stream> | ||
2986 | |||
2987 | </pre></div> | ||
2988 | <p>More detailed examples are provided under <a class='info' href='#examples'>Section 9<span> (</span><span class='info'>Detailed Examples</span><span>)</span></a>. | ||
2989 | </p> | ||
2990 | <a name="tls"></a><br /><hr /> | ||
2991 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2992 | <a name="rfc.section.5"></a><h3>5. | ||
2993 | STARTTLS Negotiation</h3> | ||
2994 | |||
2995 | <a name="tls-fundamentals"></a><br /><hr /> | ||
2996 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
2997 | <a name="rfc.section.5.1"></a><h3>5.1. | ||
2998 | Fundamentals</h3> | ||
2999 | |||
3000 | <p>XMPP includes a method for securing the stream from tampering and eavesdropping. This channel encryption method makes use of the Transport Layer Security <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a> protocol, specifically a "STARTTLS" extension that is modeled after similar extensions for the <a class='info' href='#IMAP'>[IMAP]<span> (</span><span class='info'>Crispin, M., “INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1,” March 2003.</span><span>)</span></a>, <a class='info' href='#POP3'>[POP3]<span> (</span><span class='info'>Myers, J. and M. Rose, “Post Office Protocol - Version 3,” May 1996.</span><span>)</span></a>, and <a class='info' href='#ACAP'>[ACAP]<span> (</span><span class='info'>Newman, C. and J. Myers, “ACAP -- Application Configuration Access Protocol,” November 1997.</span><span>)</span></a> protocols as described in <a class='info' href='#USINGTLS'>[USINGTLS]<span> (</span><span class='info'>Newman, C., “Using TLS with IMAP, POP3 and ACAP,” June 1999.</span><span>)</span></a>. The XML namespace name for the STARTTLS extension is 'urn:ietf:params:xml:ns:xmpp-tls'. | ||
3001 | </p> | ||
3002 | <a name="tls-support"></a><br /><hr /> | ||
3003 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3004 | <a name="rfc.section.5.2"></a><h3>5.2. | ||
3005 | Support</h3> | ||
3006 | |||
3007 | <p>Support for STARTTLS is REQUIRED in XMPP client and server implementations. An administrator of a given deployment MAY specify that TLS is mandatory-to-negotiate for client-to-server communication, server-to-server communication, or both. An initiating entity SHOULD use TLS to secure its stream with the receiving entity before proceeding with SASL authentication. | ||
3008 | </p> | ||
3009 | <a name="tls-rules"></a><br /><hr /> | ||
3010 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3011 | <a name="rfc.section.5.3"></a><h3>5.3. | ||
3012 | Stream Negotiation Rules</h3> | ||
3013 | |||
3014 | <a name="tls-rules-mtn"></a><br /><hr /> | ||
3015 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3016 | <a name="rfc.section.5.3.1"></a><h3>5.3.1. | ||
3017 | Mandatory-to-Negotiate</h3> | ||
3018 | |||
3019 | <p>If the receiving entity advertises only the STARTTLS feature or if the receiving entity includes the <required/> child element as explained under <a class='info' href='#tls-process-stream'>Section 5.4.1<span> (</span><span class='info'>Exchange of Stream Headers and Stream Features</span><span>)</span></a>, the parties MUST consider TLS as mandatory-to-negotiate. If TLS is mandatory-to-negotiate, the receiving entity SHOULD NOT advertise support for any stream feature except STARTTLS during the initial stage of the stream negotiation process, because further stream features might depend on prior negotiation of TLS given the order of layers in XMPP (e.g., the particular SASL mechanisms offered by the receiving entity will likely depend on whether TLS has been negotiated). | ||
3020 | </p> | ||
3021 | <a name="tls-rules-restart"></a><br /><hr /> | ||
3022 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3023 | <a name="rfc.section.5.3.2"></a><h3>5.3.2. | ||
3024 | Restart</h3> | ||
3025 | |||
3026 | <p>After TLS negotiation, the parties MUST restart the stream. | ||
3027 | </p> | ||
3028 | <a name="tls-rules-data"></a><br /><hr /> | ||
3029 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3030 | <a name="rfc.section.5.3.3"></a><h3>5.3.3. | ||
3031 | Data Formatting</h3> | ||
3032 | |||
3033 | <p>During STARTTLS negotiation, the entities MUST NOT send any whitespace as separators between XML elements (i.e., from the last character of the first-level <starttls/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace as sent by the initiating entity, until the last character of the first-level <proceed/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace as sent by the receiving entity). This prohibition helps to ensure proper security layer byte precision. Any such whitespace shown in the STARTTLS examples provided in this document is included only for the sake of readability. | ||
3034 | </p> | ||
3035 | <a name="tls-rules-order"></a><br /><hr /> | ||
3036 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3037 | <a name="rfc.section.5.3.4"></a><h3>5.3.4. | ||
3038 | Order of TLS and SASL Negotiations</h3> | ||
3039 | |||
3040 | <p>If the initiating entity chooses to use TLS, STARTTLS negotiation MUST be completed before proceeding to <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>; this order of negotiation is necessary to help safeguard authentication information sent during SASL negotiation, as well as to make it possible to base the use of the SASL EXTERNAL mechanism on a certificate (or other credentials) provided during prior TLS negotiation. | ||
3041 | </p> | ||
3042 | <a name="tls-rules-renegotiation"></a><br /><hr /> | ||
3043 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3044 | <a name="rfc.section.5.3.5"></a><h3>5.3.5. | ||
3045 | TLS Renegotiation</h3> | ||
3046 | |||
3047 | <p>The TLS protocol allows either party in a TLS-protected channel to initiate a new handshake that establishes new cryptographic parameters (see <a class='info' href='#TLS-NEG'>[TLS‑NEG]<span> (</span><span class='info'>Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, “Transport Layer Security (TLS) Renegotiation Indication Extension,” February 2010.</span><span>)</span></a>). The cases most commonly mentioned are: | ||
3048 | </p> | ||
3049 | <p> | ||
3050 | </p> | ||
3051 | <ol class="text"> | ||
3052 | <li>Refreshing encryption keys. | ||
3053 | </li> | ||
3054 | <li>Wrapping the TLS sequence number as explained in Section 6.1 of <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>. | ||
3055 | </li> | ||
3056 | <li>Protecting client credentials by completing server authentication first and then completing client authentication over the protected channel. | ||
3057 | </li> | ||
3058 | </ol><p> | ||
3059 | |||
3060 | </p> | ||
3061 | <p>Because it is relatively inexpensive to establish streams in XMPP, for the first two cases it is preferable to use an XMPP stream reset (as described under <a class='info' href='#streams-error-conditions-reset'>Section 4.9.3.16<span> (</span><span class='info'>reset</span><span>)</span></a>) instead of performing TLS renegotiation. | ||
3062 | </p> | ||
3063 | <p>The third case has improved security characteristics when the TLS client (which might be an XMPP server) presents credentials to the TLS server. If communicating such credentials to an unauthenticated TLS server might leak private information, it can be appropriate to complete TLS negotiation for the purpose of authenticating the TLS server to the TLS client and then attempt TLS renegotiation for the purpose of authenticating the TLS client to the TLS server. However, this case is extremely rare because the credentials presented by an XMPP server or XMPP client acting as a TLS client are almost always public (i.e., a PKIX certificate), and therefore providing those credentials before authenticating the XMPP server acting as a TLS server would not in general leak private information. | ||
3064 | </p> | ||
3065 | <p>As a result, implementers are encouraged to carefully weigh the costs and benefits of TLS renegotiation before supporting it in their software, and XMPP entities that act as TLS clients are discouraged from attempting TLS renegotiation unless the certificate (or other credential information) sent during TLS negotiation is known to be private. | ||
3066 | </p> | ||
3067 | <p>Support for TLS renegotiation is strictly OPTIONAL. However, implementations that support TLS renegotiation MUST implement and use the TLS Renegotiation Extension <a class='info' href='#TLS-NEG'>[TLS‑NEG]<span> (</span><span class='info'>Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, “Transport Layer Security (TLS) Renegotiation Indication Extension,” February 2010.</span><span>)</span></a>. | ||
3068 | </p> | ||
3069 | <p>If an entity that does not support TLS renegotiation detects a renegotiation attempt, then it MUST immediately close the underlying TCP connection without returning a stream error (since the violation has occurred at the TLS layer, not the XMPP layer, as described under <a class='info' href='#security-layers'>Section 13.3<span> (</span><span class='info'>Order of Layers</span><span>)</span></a>). | ||
3070 | </p> | ||
3071 | <p>If an entity that supports TLS renegotiation detects a TLS renegotiation attempt that does not use the TLS Renegotiation Extension <a class='info' href='#TLS-NEG'>[TLS‑NEG]<span> (</span><span class='info'>Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, “Transport Layer Security (TLS) Renegotiation Indication Extension,” February 2010.</span><span>)</span></a>, then it MUST immediately close the underlying TCP connection without returning a stream error (since the violation has occurred at the TLS layer, not the XMPP layer as described under <a class='info' href='#security-layers'>Section 13.3<span> (</span><span class='info'>Order of Layers</span><span>)</span></a>). | ||
3072 | </p> | ||
3073 | <a name="tls-rules-extensions"></a><br /><hr /> | ||
3074 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3075 | <a name="rfc.section.5.3.6"></a><h3>5.3.6. | ||
3076 | TLS Extensions</h3> | ||
3077 | |||
3078 | <p>Either party to a stream MAY include any TLS extension during the TLS negotiation itself. This is a matter for the TLS layer, not the XMPP layer. | ||
3079 | </p> | ||
3080 | <a name="tls-process"></a><br /><hr /> | ||
3081 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3082 | <a name="rfc.section.5.4"></a><h3>5.4. | ||
3083 | Process</h3> | ||
3084 | |||
3085 | <a name="tls-process-stream"></a><br /><hr /> | ||
3086 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3087 | <a name="rfc.section.5.4.1"></a><h3>5.4.1. | ||
3088 | Exchange of Stream Headers and Stream Features</h3> | ||
3089 | |||
3090 | <p>The initiating entity resolves the FQDN of the receiving entity as specified under <a class='info' href='#tcp'>Section 3<span> (</span><span class='info'>TCP Binding</span><span>)</span></a>, opens a TCP connection to the advertised port at the resolved IP address, and sends an initial stream header to the receiving entity. | ||
3091 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3092 | I: <stream:stream | ||
3093 | from='juliet@im.example.com' | ||
3094 | to='im.example.com' | ||
3095 | version='1.0' | ||
3096 | xml:lang='en' | ||
3097 | xmlns='jabber:client' | ||
3098 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3099 | </pre></div> | ||
3100 | <p>The receiving entity MUST send a response stream header to the initiating entity over the TCP connection opened by the initiating entity. | ||
3101 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3102 | R: <stream:stream | ||
3103 | from='im.example.com' | ||
3104 | id='t7AMCin9zjMNwQKDnplntZPIDEI=' | ||
3105 | to='juliet@im.example.com' | ||
3106 | version='1.0' | ||
3107 | xml:lang='en' | ||
3108 | xmlns='jabber:client' | ||
3109 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3110 | </pre></div> | ||
3111 | <p>The receiving entity then MUST send stream features to the initiating entity. If the receiving entity supports TLS, the stream features MUST include an advertisement for support of STARTTLS negotiation, i.e., a <starttls/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace. | ||
3112 | </p> | ||
3113 | <p>If the receiving entity considers STARTTLS negotiation to be mandatory-to-negotiate, the <starttls/> element MUST contain an empty <required/> child element. | ||
3114 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3115 | R: <stream:features> | ||
3116 | <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> | ||
3117 | <required/> | ||
3118 | </starttls> | ||
3119 | </stream:features> | ||
3120 | </pre></div> | ||
3121 | <a name="tls-process-initiate"></a><br /><hr /> | ||
3122 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3123 | <a name="rfc.section.5.4.2"></a><h3>5.4.2. | ||
3124 | Initiation of STARTTLS Negotiation</h3> | ||
3125 | |||
3126 | <a name="tls-process-initiate-command"></a><br /><hr /> | ||
3127 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3128 | <a name="rfc.section.5.4.2.1"></a><h3>5.4.2.1. | ||
3129 | STARTTLS Command</h3> | ||
3130 | |||
3131 | <p>In order to begin the STARTTLS negotiation, the initiating entity issues the STARTTLS command (i.e., a <starttls/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace) to instruct the receiving entity that it wishes to begin a STARTTLS negotiation to secure the stream. | ||
3132 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3133 | I: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
3134 | </pre></div> | ||
3135 | <p>The receiving entity MUST reply with either a <proceed/> element (proceed case) or a <failure/> element (failure case) qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace. | ||
3136 | </p> | ||
3137 | <a name="tls-process-initiate-failure"></a><br /><hr /> | ||
3138 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3139 | <a name="rfc.section.5.4.2.2"></a><h3>5.4.2.2. | ||
3140 | Failure Case</h3> | ||
3141 | |||
3142 | <p>If the failure case occurs, the receiving entity MUST return a <failure/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace, close the XML stream, and terminate the underlying TCP connection. | ||
3143 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3144 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
3145 | |||
3146 | R: </stream:stream> | ||
3147 | </pre></div> | ||
3148 | <p>Causes for the failure case include but are not limited to: | ||
3149 | </p> | ||
3150 | <p> | ||
3151 | </p> | ||
3152 | <ol class="text"> | ||
3153 | <li>The initiating entity has sent a malformed STARTTLS command. | ||
3154 | </li> | ||
3155 | <li>The receiving entity did not offer the STARTTLS feature in its stream features. | ||
3156 | </li> | ||
3157 | <li>The receiving entity cannot complete STARTTLS negotiation because of an internal error. | ||
3158 | </li> | ||
3159 | </ol><p> | ||
3160 | |||
3161 | </p> | ||
3162 | <p></p> | ||
3163 | <blockquote class="text"> | ||
3164 | <p>Informational Note: STARTTLS failure is not triggered by TLS errors such as bad_certificate or handshake_failure, which are generated and handled during the TLS negotiation itself as described in <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>. | ||
3165 | </p> | ||
3166 | </blockquote> | ||
3167 | |||
3168 | <p>If the failure case occurs, the initiating entity MAY attempt to reconnect as explained under <a class='info' href='#tcp-reconnect'>Section 3.3<span> (</span><span class='info'>Reconnection</span><span>)</span></a>. | ||
3169 | </p> | ||
3170 | <a name="tls-process-initiate-proceed"></a><br /><hr /> | ||
3171 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3172 | <a name="rfc.section.5.4.2.3"></a><h3>5.4.2.3. | ||
3173 | Proceed Case</h3> | ||
3174 | |||
3175 | <p>If the proceed case occurs, the receiving entity MUST return a <proceed/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-tls' namespace. | ||
3176 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3177 | R: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
3178 | </pre></div> | ||
3179 | <p>The receiving entity MUST consider the TLS negotiation to have begun immediately after sending the closing '>' character of the <proceed/> element to the initiating entity. The initiating entity MUST consider the TLS negotiation to have begun immediately after receiving the closing '>' character of the <proceed/> element from the receiving entity. | ||
3180 | </p> | ||
3181 | <p>The entities now proceed to TLS negotiation as explained in the next section. | ||
3182 | </p> | ||
3183 | <a name="tls-process-neg"></a><br /><hr /> | ||
3184 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3185 | <a name="rfc.section.5.4.3"></a><h3>5.4.3. | ||
3186 | TLS Negotiation</h3> | ||
3187 | |||
3188 | <a name="tls-process-neg-rules"></a><br /><hr /> | ||
3189 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3190 | <a name="rfc.section.5.4.3.1"></a><h3>5.4.3.1. | ||
3191 | Rules</h3> | ||
3192 | |||
3193 | <p>In order to complete TLS negotiation over the TCP connection, the entities MUST follow the process defined in <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>. | ||
3194 | </p> | ||
3195 | <p>The following rules apply: | ||
3196 | </p> | ||
3197 | <p> | ||
3198 | </p> | ||
3199 | <ol class="text"> | ||
3200 | <li>The entities MUST NOT send any further XML data until the TLS negotiation is complete. | ||
3201 | </li> | ||
3202 | <li>When using any of the mandatory-to-implement (MTI) ciphersuites specified under <a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a>, the receiving entity MUST present a certificate. | ||
3203 | </li> | ||
3204 | <li>So that mutual certificate authentication will be possible, the receiving entity SHOULD send a certificate request to the initiating entity, and the initiating entity SHOULD send a certificate to the receiving entity (but for privacy reasons might opt not to send a certificate until after the receiving entity has authenticated to the initiating entity). | ||
3205 | </li> | ||
3206 | <li>The receiving entity SHOULD choose which certificate to present based on the domainpart contained in the 'to' attribute of the initial stream header (in essence, this domainpart is functionally equivalent to the Server Name Indication defined for TLS in <a class='info' href='#TLS-EXT'>[TLS‑EXT]<span> (</span><span class='info'>Eastlake 3rd, D., “Transport Layer Security (TLS) Extensions: Extension Definitions,” January 2011.</span><span>)</span></a>). | ||
3207 | </li> | ||
3208 | <li>To determine if the TLS negotiation will succeed, the initiating entity MUST attempt to validate the receiving entity's certificate in accordance with the certificate validation procedures specified under <a class='info' href='#security-certificates-validation'>Section 13.7.2<span> (</span><span class='info'>Certificate Validation</span><span>)</span></a>. | ||
3209 | </li> | ||
3210 | <li>If the initiating entity presents a certificate, the receiving entity too MUST attempt to validate the initiating entity's certificate in accordance with the certificate validation procedures specified under <a class='info' href='#security-certificates-validation'>Section 13.7.2<span> (</span><span class='info'>Certificate Validation</span><span>)</span></a>. | ||
3211 | </li> | ||
3212 | <li>Following successful TLS negotiation, all further data transmitted by either party MUST be protected with the negotiated algorithms, keys, and secrets (i.e., encrypted, integrity-protected, or both depending on the ciphersuite used). | ||
3213 | </li> | ||
3214 | </ol><p> | ||
3215 | |||
3216 | </p> | ||
3217 | <p></p> | ||
3218 | <blockquote class="text"> | ||
3219 | <p>Security Warning: See <a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> regarding ciphersuites that MUST be supported for TLS; naturally, other ciphersuites MAY be supported as well. | ||
3220 | </p> | ||
3221 | </blockquote> | ||
3222 | |||
3223 | <a name="tls-process-neg-failure"></a><br /><hr /> | ||
3224 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3225 | <a name="rfc.section.5.4.3.2"></a><h3>5.4.3.2. | ||
3226 | TLS Failure</h3> | ||
3227 | |||
3228 | <p>If the TLS negotiation results in failure, the receiving entity MUST terminate the TCP connection. | ||
3229 | </p> | ||
3230 | <p>The receiving entity MUST NOT send a closing </stream> tag before terminating the TCP connection (since the failure has occurred at the TLS layer, not the XMPP layer as described under <a class='info' href='#security-layers'>Section 13.3<span> (</span><span class='info'>Order of Layers</span><span>)</span></a>). | ||
3231 | </p> | ||
3232 | <p>The initiating entity MAY attempt to reconnect as explained under <a class='info' href='#tcp-reconnect'>Section 3.3<span> (</span><span class='info'>Reconnection</span><span>)</span></a>, with or without attempting TLS negotiation (in accordance with local service policy, user-configured preferences, etc.). | ||
3233 | </p> | ||
3234 | <a name="tls-process-neg-success"></a><br /><hr /> | ||
3235 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3236 | <a name="rfc.section.5.4.3.3"></a><h3>5.4.3.3. | ||
3237 | TLS Success</h3> | ||
3238 | |||
3239 | <p>If the TLS negotiation is successful, then the entities MUST proceed as follows. | ||
3240 | </p> | ||
3241 | <p> | ||
3242 | </p> | ||
3243 | <ol class="text"> | ||
3244 | <li>The initiating entity MUST discard any information transmitted in layers above TCP that it obtained from the receiving entity in an insecure manner before TLS took effect (e.g., the receiving entity's 'from' address or the stream ID and stream features received from the receiving entity). | ||
3245 | </li> | ||
3246 | <li>The receiving entity MUST discard any information transmitted in layers above TCP that it obtained from the initiating entity in an insecure manner before TLS took effect (e.g., the initiating entity's 'from' address). | ||
3247 | </li> | ||
3248 | <li>The initiating entity MUST send a new initial stream header to the receiving entity over the encrypted connection (as specified under <a class='info' href='#streams-negotiation-restart'>Section 4.3.3<span> (</span><span class='info'>Restarts</span><span>)</span></a>, the initiating entity MUST NOT send a closing </stream> tag before sending the new initial stream header, since the receiving entity and initiating entity MUST consider the original stream to be replaced upon success of the TLS negotiation). | ||
3249 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3250 | I: <stream:stream | ||
3251 | from='juliet@im.example.com' | ||
3252 | to='im.example.com' | ||
3253 | version='1.0' | ||
3254 | xml:lang='en' | ||
3255 | xmlns='jabber:client' | ||
3256 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3257 | </pre></div> | ||
3258 | |||
3259 | </li> | ||
3260 | <li>The receiving entity MUST respond with a new response stream header over the encrypted connection (for which it MUST generate a new stream ID instead of reusing the old stream ID). | ||
3261 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3262 | R: <stream:stream | ||
3263 | from='im.example.com' | ||
3264 | id='vgKi/bkYME8OAj4rlXMkpucAqe4=' | ||
3265 | to='juliet@im.example.com' | ||
3266 | version='1.0' | ||
3267 | xml:lang='en' | ||
3268 | xmlns='jabber:client' | ||
3269 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3270 | </pre></div> | ||
3271 | |||
3272 | </li> | ||
3273 | <li>The receiving entity also MUST send stream features to the initiating entity, which MUST NOT include the STARTTLS feature but which SHOULD include the SASL stream feature as described under <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> (see especially <a class='info' href='#sasl-process-stream'>Section 6.4.1<span> (</span><span class='info'>Exchange of Stream Headers and Stream Features</span><span>)</span></a> regarding the few reasons why the SASL stream feature would not be offered here). | ||
3274 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3275 | R: <stream:features> | ||
3276 | <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3277 | <mechanism>EXTERNAL</mechanism> | ||
3278 | <mechanism>SCRAM-SHA-1-PLUS</mechanism> | ||
3279 | <mechanism>SCRAM-SHA-1</mechanism> | ||
3280 | <mechanism>PLAIN</mechanism> | ||
3281 | </mechanisms> | ||
3282 | </stream:features> | ||
3283 | </pre></div> | ||
3284 | |||
3285 | </li> | ||
3286 | </ol><p> | ||
3287 | |||
3288 | </p> | ||
3289 | <a name="sasl"></a><br /><hr /> | ||
3290 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3291 | <a name="rfc.section.6"></a><h3>6. | ||
3292 | SASL Negotiation</h3> | ||
3293 | |||
3294 | <a name="sasl-fundamentals"></a><br /><hr /> | ||
3295 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3296 | <a name="rfc.section.6.1"></a><h3>6.1. | ||
3297 | Fundamentals</h3> | ||
3298 | |||
3299 | <p>XMPP includes a method for authenticating a stream by means of an XMPP-specific profile of the Simple Authentication and Security Layer protocol (see <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>). SASL provides a generalized method for adding authentication support to connection-based protocols, and XMPP uses an XML namespace profile of SASL that conforms to the profiling requirements of <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>. The XML namespace name for the SASL extension is 'urn:ietf:params:xml:ns:xmpp-sasl'. | ||
3300 | </p> | ||
3301 | <a name="sasl-support"></a><br /><hr /> | ||
3302 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3303 | <a name="rfc.section.6.2"></a><h3>6.2. | ||
3304 | Support</h3> | ||
3305 | |||
3306 | <p>Support for SASL negotiation is REQUIRED in XMPP client and server implementations. | ||
3307 | </p> | ||
3308 | <a name="sasl-rules"></a><br /><hr /> | ||
3309 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3310 | <a name="rfc.section.6.3"></a><h3>6.3. | ||
3311 | Stream Negotiation Rules</h3> | ||
3312 | |||
3313 | <a name="sasl-rules-mtn"></a><br /><hr /> | ||
3314 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3315 | <a name="rfc.section.6.3.1"></a><h3>6.3.1. | ||
3316 | Mandatory-to-Negotiate</h3> | ||
3317 | |||
3318 | <p>The parties to a stream MUST consider SASL as mandatory-to-negotiate. | ||
3319 | </p> | ||
3320 | <a name="sasl-rules-restart"></a><br /><hr /> | ||
3321 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3322 | <a name="rfc.section.6.3.2"></a><h3>6.3.2. | ||
3323 | Restart</h3> | ||
3324 | |||
3325 | <p>After SASL negotiation, the parties MUST restart the stream. | ||
3326 | </p> | ||
3327 | <a name="sasl-rules-preferences"></a><br /><hr /> | ||
3328 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3329 | <a name="rfc.section.6.3.3"></a><h3>6.3.3. | ||
3330 | Mechanism Preferences</h3> | ||
3331 | |||
3332 | <p>Any entity that will act as a SASL client or a SASL server MUST | ||
3333 | maintain an ordered list of its preferred SASL mechanisms according to the | ||
3334 | client or server, where the list is ordered according to local policy or user | ||
3335 | configuration (which SHOULD be in order of perceived strength to enable the | ||
3336 | strongest authentication possible). The initiating entity MUST maintain its | ||
3337 | own preference order independent of the preference order of the receiving | ||
3338 | entity. A client MUST try SASL mechanisms in its preference order. For example, if the server offers the ordered list "PLAIN SCRAM-SHA-1 GSSAPI" or "SCRAM-SHA-1 GSSAPI PLAIN" but the client's ordered list is "GSSAPI SCRAM-SHA-1", the client MUST try GSSAPI first and then SCRAM-SHA-1 but MUST NOT try PLAIN (since PLAIN is not on its list). | ||
3339 | </p> | ||
3340 | <a name="sasl-rules-offers"></a><br /><hr /> | ||
3341 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3342 | <a name="rfc.section.6.3.4"></a><h3>6.3.4. | ||
3343 | Mechanism Offers</h3> | ||
3344 | |||
3345 | <p>If the receiving entity considers <a class='info' href='#tls'>TLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> to be mandatory-to-negotiate before it will accept authentication with a particular SASL mechanism, it MUST NOT advertise that mechanism in its list of available SASL mechanisms before TLS negotiation has been completed. | ||
3346 | </p> | ||
3347 | <p>The receiving entity SHOULD offer the SASL EXTERNAL mechanism if both of the following conditions hold: | ||
3348 | </p> | ||
3349 | <p> | ||
3350 | </p> | ||
3351 | <ol class="text"> | ||
3352 | <li>During TLS negotiation the initiating entity presented a certificate that is acceptable to the receiving entity for purposes of strong identity verification in accordance with local service policies (e.g., because said certificate is unexpired, is unrevoked, and is anchored to a root trusted by the receiving entity). | ||
3353 | </li> | ||
3354 | <li>The receiving entity expects that the initiating entity will be able to authenticate and authorize as the identity provided in the certificate; in the case of a server-to-server stream, the receiving entity might have such an expectation because a DNS domain name presented in the initiating entity's certificate matches the domain referenced in the 'from' attribute of the initial stream header, where the matching rules of <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> apply; in the case of a client-to-server stream, the receiving entity might have such an expectation because the bare JID presented in the initiating entity's certificate matches a user account that is registered with the server or because other information contained in the initiating entity's certificate matches that of an entity that has permission to use the server for access to an XMPP network. | ||
3355 | </li> | ||
3356 | </ol><p> | ||
3357 | |||
3358 | </p> | ||
3359 | <p>However, the receiving entity MAY offer the SASL EXTERNAL mechanism under other circumstances, as well. | ||
3360 | </p> | ||
3361 | <p>When the receiving entity offers the SASL EXTERNAL mechanism, the receiving entity SHOULD list the EXTERNAL mechanism first among its offered SASL mechanisms and the initiating entity SHOULD attempt SASL negotiation using the EXTERNAL mechanism first (this preference will tend to increase the likelihood that the parties can negotiate mutual certificate authentication). | ||
3362 | </p> | ||
3363 | <p><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> specifies SASL mechanisms that MUST be supported; naturally, other SASL mechanisms MAY be supported as well. | ||
3364 | </p> | ||
3365 | <p></p> | ||
3366 | <blockquote class="text"> | ||
3367 | <p>Informational Note: Best practices for the use of SASL in the context of XMPP are described in <a class='info' href='#XEP-0175'>[XEP‑0175]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices for Use of SASL ANONYMOUS,” September 2009.</span><span>)</span></a> for the ANONYMOUS mechanism and in <a class='info' href='#XEP-0178'>[XEP‑0178]<span> (</span><span class='info'>Saint-Andre, P. and P. Millard, “Best Practices for Use of SASL EXTERNAL with Certificates,” February 2007.</span><span>)</span></a> for the EXTERNAL mechanism. | ||
3368 | </p> | ||
3369 | </blockquote> | ||
3370 | |||
3371 | <a name="sasl-rules-data"></a><br /><hr /> | ||
3372 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3373 | <a name="rfc.section.6.3.5"></a><h3>6.3.5. | ||
3374 | Data Formatting</h3> | ||
3375 | |||
3376 | <p>The following data formatting rules apply to the SASL negotiation: | ||
3377 | </p> | ||
3378 | <p> | ||
3379 | </p> | ||
3380 | <ol class="text"> | ||
3381 | <li>During SASL negotiation, the entities MUST NOT send any whitespace as separators between XML elements (i.e., from the last character of the first-level <auth/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace as sent by the initiating entity, until the last character of the first-level <success/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace as sent by the receiving entity). This prohibition helps to ensure proper security layer byte precision. Any such whitespace shown in the SASL examples provided in this document is included only for the sake of readability. | ||
3382 | </li> | ||
3383 | <li>Any XML character data contained within the XML elements MUST be encoded using base 64, where the encoding adheres to the definition in Section 4 of <a class='info' href='#BASE64'>[BASE64]<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a> and where the padding bits are set to zero. | ||
3384 | </li> | ||
3385 | <li>As formally specified in the XML schema for the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace under <a class='info' href='#schemas-sasl'>Appendix A.4<span> (</span><span class='info'>SASL Namespace</span><span>)</span></a>, the receiving entity MAY include one or more application-specific child elements inside the <mechanisms/> element to provide information that might be needed by the initiating entity in order to complete successful SASL negotiation using one or more of the offered mechanisms; however, the syntax and semantics of all such elements are out of scope for this specification (see <a class='info' href='#XEP-0233'>[XEP‑0233]<span> (</span><span class='info'>Miller, M., Saint-Andre, P., and J. Hildebrand, “Domain-Based Service Names in XMPP SASL Negotiation,” June 2010.</span><span>)</span></a> for one example). | ||
3386 | </li> | ||
3387 | </ol><p> | ||
3388 | |||
3389 | </p> | ||
3390 | <a name="sasl-rules-layers"></a><br /><hr /> | ||
3391 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3392 | <a name="rfc.section.6.3.6"></a><h3>6.3.6. | ||
3393 | Security Layers</h3> | ||
3394 | |||
3395 | <p>Upon successful SASL negotiation that involves negotiation | ||
3396 | of a security layer, both the initiating entity and the | ||
3397 | receiving entity MUST discard any application-layer state (i.e, state from the XMPP layer, excluding state from the TLS negotiation or SASL negotiation). | ||
3398 | </p> | ||
3399 | <a name="sasl-rules-username"></a><br /><hr /> | ||
3400 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3401 | <a name="rfc.section.6.3.7"></a><h3>6.3.7. | ||
3402 | Simple User Name</h3> | ||
3403 | |||
3404 | <p>Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify that the authentication identity used in the context of such mechanisms is a "simple user name" (see Section 2 of <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a> as well as <a class='info' href='#SASLPREP'>[SASLPREP]<span> (</span><span class='info'>Zeilenga, K., “SASLprep: Stringprep Profile for User Names and Passwords,” February 2005.</span><span>)</span></a>). The exact form of the simple user name in any particular mechanism or deployment thereof is a local matter, and a simple user name does not necessarily map to an application identifier such as a JID or JID component (e.g., a localpart). However, in the absence of local information provided by the server, an XMPP client SHOULD assume that the authentication identity for such a SASL mechanism is a simple user name equal to the localpart of the user's JID. | ||
3405 | </p> | ||
3406 | <a name="sasl-rules-authzid"></a><br /><hr /> | ||
3407 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3408 | <a name="rfc.section.6.3.8"></a><h3>6.3.8. | ||
3409 | Authorization Identity</h3> | ||
3410 | |||
3411 | <p>An authorization identity is an OPTIONAL identity included by the initiating entity to specify an identity to act as (see Section 2 of <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>). In client-to-server streams, it would most likely be used by an administrator to perform some management task on behalf of another user, whereas in server-to-server streams it would most likely be used to specify a particular add-on service at an XMPP service (e.g., a multi-user chat server at conference.example.com that is hosted by the example.com XMPP service). If the initiating entity wishes to act on behalf of another entity and the selected SASL mechanism supports transmission of an authorization identity, the initiating entity MUST provide an authorization identity during SASL negotiation. If the initiating entity does not wish to act on behalf of another entity, it MUST NOT provide an authorization identity. | ||
3412 | </p> | ||
3413 | <p>In the case of client-to-server communication, the value of an authorization identity MUST be a bare JID (<localpart@domainpart>) rather than a full JID (<localpart@domainpart/resourcepart>). | ||
3414 | </p> | ||
3415 | <p>In the case of server-to-server communication, the value of an authorization identity MUST be a domainpart only (<domainpart>). | ||
3416 | </p> | ||
3417 | <p>If the initiating entity provides an authorization identity during SASL negotiation, the receiving entity is responsible for verifying that the initiating entity is in fact allowed to assume the specified authorization identity; if not, the receiving entity MUST return an <invalid-authzid/> SASL error as described under <a class='info' href='#sasl-errors-invalid-authzid'>Section 6.5.6<span> (</span><span class='info'>invalid-authzid</span><span>)</span></a>. | ||
3418 | </p> | ||
3419 | <a name="sasl-rules-realms"></a><br /><hr /> | ||
3420 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3421 | <a name="rfc.section.6.3.9"></a><h3>6.3.9. | ||
3422 | Realms</h3> | ||
3423 | |||
3424 | <p>The receiving entity MAY include a realm when negotiating certain SASL mechanisms (e.g., both the GSSAPI and DIGEST-MD5 mechanisms allow the authentication exchange to include a realm, though in different ways, whereas the EXTERNAL, SCRAM, and PLAIN mechanisms do not). If the receiving entity does not communicate a realm, the initiating entity MUST NOT assume that any realm exists. The realm MUST be used only for the purpose of authentication; in particular, an initiating entity MUST NOT attempt to derive an XMPP domainpart from the realm information provided by the receiving entity. | ||
3425 | </p> | ||
3426 | <a name="sasl-rules-roundtrips"></a><br /><hr /> | ||
3427 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3428 | <a name="rfc.section.6.3.10"></a><h3>6.3.10. | ||
3429 | Round Trips</h3> | ||
3430 | |||
3431 | <p><a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a> specifies that a using protocol such as XMPP can define two methods by which the protocol can save round trips where allowed for the SASL mechanism: | ||
3432 | </p> | ||
3433 | <p> | ||
3434 | </p> | ||
3435 | <ol class="text"> | ||
3436 | <li>When the SASL client (the XMPP "initiating entity") requests an authentication exchange, it can include "initial response" data with its request if appropriate for the SASL mechanism in use. In XMPP, this is done by including the initial response as the XML character data of the <auth/> element. | ||
3437 | </li> | ||
3438 | <li>At the end of the authentication exchange, the SASL server (the XMPP "receiving entity") can include "additional data with success" if appropriate for the SASL mechanism in use. In XMPP, this is done by including the additional data as the XML character data of the <success/> element. | ||
3439 | </li> | ||
3440 | </ol><p> | ||
3441 | |||
3442 | </p> | ||
3443 | <p>For the sake of protocol efficiency, it is REQUIRED for clients and servers to support these methods and RECOMMENDED to use them; however, clients and servers MUST support the less efficient modes as well. | ||
3444 | </p> | ||
3445 | <a name="sasl-process"></a><br /><hr /> | ||
3446 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3447 | <a name="rfc.section.6.4"></a><h3>6.4. | ||
3448 | Process</h3> | ||
3449 | |||
3450 | <p>The process for SASL negotiation is as follows. | ||
3451 | </p> | ||
3452 | <a name="sasl-process-stream"></a><br /><hr /> | ||
3453 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3454 | <a name="rfc.section.6.4.1"></a><h3>6.4.1. | ||
3455 | Exchange of Stream Headers and Stream Features</h3> | ||
3456 | |||
3457 | <p>If SASL negotiation follows successful <a class='info' href='#tls'>STARTTLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>, then the SASL negotiation occurs over the protected stream that has already been negotiated. If not, the initiating entity resolves the FQDN of the receiving entity as specified under <a class='info' href='#tcp'>Section 3<span> (</span><span class='info'>TCP Binding</span><span>)</span></a>, opens a TCP connection to the advertised port at the resolved IP address, and sends an initial stream header to the receiving entity. In either case, the receiving entity will receive an initial stream from the initiating entity. | ||
3458 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3459 | I: <stream:stream | ||
3460 | from='juliet@im.example.com' | ||
3461 | to='im.example.com' | ||
3462 | version='1.0' | ||
3463 | xml:lang='en' | ||
3464 | xmlns='jabber:client' | ||
3465 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3466 | </pre></div> | ||
3467 | <p>When the receiving entity processes an initial stream header from the initiating entity, it MUST send a response stream header to the initiating entity (for which it MUST generate a unique stream ID. If TLS negotiation has already succeeded, then this stream ID MUST be different from the stream ID sent before TLS negotiation succeeded). | ||
3468 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3469 | R: <stream:stream | ||
3470 | from='im.example.com' | ||
3471 | id='vgKi/bkYME8OAj4rlXMkpucAqe4=' | ||
3472 | to='juliet@im.example.com' | ||
3473 | version='1.0' | ||
3474 | xml:lang='en' | ||
3475 | xmlns='jabber:client' | ||
3476 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3477 | </pre></div> | ||
3478 | <p>The receiving entity also MUST send stream features to the initiating entity. The stream features SHOULD include an advertisement for support of SASL negotiation, i.e., a <mechanisms/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace. Typically there are only three cases in which support for SASL negotiation would not be advertised here: | ||
3479 | </p> | ||
3480 | <p> | ||
3481 | </p> | ||
3482 | <ul class="text"> | ||
3483 | <li>TLS negotiation needs to happen before SASL can be offered (i.e., TLS is required and the receiving entity is responding to the very first initial stream header it has received for this connection attempt). | ||
3484 | </li> | ||
3485 | <li>SASL negotiation is impossible for a server-to-server connection (i.e., the initiating server has not provided a certificate that would enable strong authentication and therefore the receiving server is falling back to weak identity verification using the Server Dialback protocol <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>). | ||
3486 | </li> | ||
3487 | <li>SASL has already been negotiated (i.e., the receiving entity is responding to an initial stream header sent as a stream restart after successful SASL negotiation). | ||
3488 | </li> | ||
3489 | </ul><p> | ||
3490 | |||
3491 | </p> | ||
3492 | <p>The <mechanisms/> element MUST contain one <mechanism/> child element for each authentication mechanism the receiving entity offers to the initiating entity. As noted, the order of <mechanism/> elements in the XML indicates the preference order of the SASL mechanisms according to the receiving entity (which is not necessarily the preference order according to the initiating entity). | ||
3493 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3494 | R: <stream:features> | ||
3495 | <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3496 | <mechanism>EXTERNAL</mechanism> | ||
3497 | <mechanism>SCRAM-SHA-1-PLUS</mechanism> | ||
3498 | <mechanism>SCRAM-SHA-1</mechanism> | ||
3499 | <mechanism>PLAIN</mechanism> | ||
3500 | </mechanisms> | ||
3501 | </stream:features> | ||
3502 | </pre></div> | ||
3503 | <a name="sasl-process-neg-initiate"></a><br /><hr /> | ||
3504 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3505 | <a name="rfc.section.6.4.2"></a><h3>6.4.2. | ||
3506 | Initiation</h3> | ||
3507 | |||
3508 | <p>In order to begin the SASL negotiation, the initiating entity sends an <auth/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace and includes an appropriate value for the 'mechanism' attribute, thus starting the handshake for that particular authentication mechanism. This element MAY contain XML character data (in SASL terminology, the "initial response") if the mechanism supports or requires it. If the initiating entity needs to send a zero-length initial response, it MUST transmit the response as a single equals sign character ("="), which indicates that the response is present but contains no data. | ||
3509 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3510 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3511 | mechanism='PLAIN'>AGp1bGlldAByMG0zMG15cjBtMzA=</auth> | ||
3512 | </pre></div> | ||
3513 | <p>If the initiating entity subsequently sends another <auth/> element and the ongoing authentication handshake has not yet completed, the receiving entity MUST discard the ongoing handshake and MUST process a new handshake for the subsequently requested SASL mechanism. | ||
3514 | </p> | ||
3515 | <a name="sasl-process-neg-challengeresponse"></a><br /><hr /> | ||
3516 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3517 | <a name="rfc.section.6.4.3"></a><h3>6.4.3. | ||
3518 | Challenge-Response Sequence</h3> | ||
3519 | |||
3520 | <p>If necessary, the receiving entity challenges the initiating entity by sending a <challenge/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace; this element MAY contain XML character data (which MUST be generated in accordance with the definition of the SASL mechanism chosen by the initiating entity). | ||
3521 | </p> | ||
3522 | <p>The initiating entity responds to the challenge by sending a <response/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace; this element MAY contain XML character data (which MUST be generated in accordance with the definition of the SASL mechanism chosen by the initiating entity). | ||
3523 | </p> | ||
3524 | <p>If necessary, the receiving entity sends more challenges and the initiating entity sends more responses. | ||
3525 | </p> | ||
3526 | <p>This series of challenge/response pairs continues until one of three things happens: | ||
3527 | </p> | ||
3528 | <p> | ||
3529 | </p> | ||
3530 | <ul class="text"> | ||
3531 | <li>The initiating entity aborts the handshake for this authentication mechanism. | ||
3532 | </li> | ||
3533 | <li>The receiving entity reports failure of the handshake. | ||
3534 | </li> | ||
3535 | <li>The receiving entity reports success of the handshake. | ||
3536 | </li> | ||
3537 | </ul><p> | ||
3538 | |||
3539 | </p> | ||
3540 | <p>These scenarios are described in the following sections. | ||
3541 | </p> | ||
3542 | <a name="sasl-process-neg-abort"></a><br /><hr /> | ||
3543 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3544 | <a name="rfc.section.6.4.4"></a><h3>6.4.4. | ||
3545 | Abort</h3> | ||
3546 | |||
3547 | <p>The initiating entity aborts the handshake for this authentication mechanism by sending an <abort/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace. | ||
3548 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3549 | I: <abort xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> | ||
3550 | </pre></div> | ||
3551 | <p>Upon receiving an <abort/> element, the receiving entity MUST return a <failure/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace and containing an <aborted/> child element. | ||
3552 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3553 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3554 | <aborted/> | ||
3555 | </failure> | ||
3556 | </pre></div> | ||
3557 | <a name="sasl-process-neg-failure"></a><br /><hr /> | ||
3558 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3559 | <a name="rfc.section.6.4.5"></a><h3>6.4.5. | ||
3560 | SASL Failure</h3> | ||
3561 | |||
3562 | <p>The receiving entity reports failure of the handshake for this authentication mechanism by sending a <failure/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace (the particular cause of failure MUST be communicated in an appropriate child element of the <failure/> element as defined under <a class='info' href='#sasl-errors'>Section 6.5<span> (</span><span class='info'>SASL Errors</span><span>)</span></a>). | ||
3563 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3564 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3565 | <not-authorized/> | ||
3566 | </failure> | ||
3567 | </pre></div> | ||
3568 | <p>Where appropriate for the chosen SASL mechanism, the | ||
3569 | receiving entity SHOULD allow a configurable but reasonable | ||
3570 | number of retries (at least 2 and no more than 5); this | ||
3571 | enables the initiating entity (e.g., an end-user client) to | ||
3572 | tolerate incorrectly provided credentials (e.g., a mistyped password) without being forced to reconnect (which it would if the receiving entity immediately returned a SASL failure and closed the stream). | ||
3573 | </p> | ||
3574 | <p>If the initiating entity attempts a reasonable number of retries with the same SASL mechanism and all attempts fail, it MAY fall back to the next mechanism in its ordered list by sending a new <auth/> request to the receiving entity, thus starting a new handshake for that authentication mechanism. If all handshakes fail and there are no remaining mechanisms in the initiating entity's list of supported and acceptable mechanisms, the initiating entity SHOULD simply close the stream as described under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a> (instead of waiting for the stream to time out). | ||
3575 | </p> | ||
3576 | <p>If the initiating entity exceeds the number of retries, the receiving entity MUST close the stream with a stream error, which SHOULD be <policy-violation/> (<a class='info' href='#streams-error-conditions-policy-violation'>Section 4.9.3.14<span> (</span><span class='info'>policy-violation</span><span>)</span></a>), although some existing implementations send <not-authorized/> (<a class='info' href='#streams-error-conditions-not-authorized'>Section 4.9.3.12<span> (</span><span class='info'>not-authorized</span><span>)</span></a>) instead. | ||
3577 | </p> | ||
3578 | <p></p> | ||
3579 | <blockquote class="text"> | ||
3580 | <p>Implementation Note: For server-to-server streams, if the receiving entity cannot offer the SASL EXTERNAL mechanism or any other SASL mechanism based on the security context established during TLS negotiation, the receiving entity MAY attempt to complete weak identity verification using the Server Dialback protocol <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>; however, if according to local service policies weak identity verification is insufficient then the receiving entity SHOULD instead close the stream with a <policy-violation/> stream error (<a class='info' href='#streams-error-conditions-policy-violation'>Section 4.9.3.14<span> (</span><span class='info'>policy-violation</span><span>)</span></a>) instead of waiting for the stream to time out. | ||
3581 | </p> | ||
3582 | </blockquote> | ||
3583 | |||
3584 | <a name="sasl-process-neg-success"></a><br /><hr /> | ||
3585 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3586 | <a name="rfc.section.6.4.6"></a><h3>6.4.6. | ||
3587 | SASL Success</h3> | ||
3588 | |||
3589 | <p>Before considering the SASL handshake to be a success, if the initiating entity provided a 'from' attribute on an initial stream header whose confidentiality and integrity were protected via TLS or an equivalent security layer (such as the SASL GSSAPI mechanism) then the receiving entity SHOULD correlate the authentication identity resulting from the SASL negotiation with that 'from' address; if the two identities do not match then the receiving entity SHOULD terminate the connection attempt (however, the receiving entity might have legitimate reasons not to terminate the connection attempt, for example, because it has overridden a connecting client's address to correct the JID format or assign a JID based on information presented in an end-user certificate). | ||
3590 | </p> | ||
3591 | <p>The receiving entity reports success of the handshake by sending a <success/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-sasl' namespace; this element MAY contain XML character data (in SASL terminology, "additional data with success") if the chosen SASL mechanism supports or requires it. If the receiving entity needs to send additional data of zero length, it MUST transmit the data as a single equals sign character ("="). | ||
3592 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3593 | R: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> | ||
3594 | </pre></div> | ||
3595 | <p></p> | ||
3596 | <blockquote class="text"> | ||
3597 | <p>Informational Note: For client-to-server streams, the authorization identity communicated during SASL negotiation is used to determine the canonical address for the initiating client according to the receiving server, as described under <a class='info' href='#streams-negotiation-address'>Section 4.3.6<span> (</span><span class='info'>Determination of Addresses</span><span>)</span></a>. | ||
3598 | </p> | ||
3599 | </blockquote> | ||
3600 | |||
3601 | <p>Upon receiving the <success/> element, the initiating entity MUST initiate a new stream over the existing TCP connection by sending a new initial stream header to the receiving entity (as specified under <a class='info' href='#streams-negotiation-restart'>Section 4.3.3<span> (</span><span class='info'>Restarts</span><span>)</span></a>, the initiating entity MUST NOT send a closing </stream> tag before sending the new initial stream header, since the receiving entity and initiating entity MUST consider the original stream to be replaced upon success of the SASL negotiation). | ||
3602 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3603 | I: <stream:stream | ||
3604 | from='juliet@im.example.com' | ||
3605 | to='im.example.com' | ||
3606 | version='1.0' | ||
3607 | xml:lang='en' | ||
3608 | xmlns='jabber:client' | ||
3609 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3610 | </pre></div> | ||
3611 | <p>Upon receiving the new initial stream header from the initiating entity, the receiving entity MUST respond by sending a new response stream header to the initiating entity (for which it MUST generate a new stream ID instead of reusing the old stream ID). | ||
3612 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3613 | R: <stream:stream | ||
3614 | from='im.example.com' | ||
3615 | id='gPybzaOzBmaADgxKXu9UClbprp0=' | ||
3616 | to='juliet@im.example.com' | ||
3617 | version='1.0' | ||
3618 | xml:lang='en' | ||
3619 | xmlns='jabber:client' | ||
3620 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3621 | </pre></div> | ||
3622 | <p>The receiving entity MUST also send stream features, containing any further available features or containing no features (via an empty <features/> element). | ||
3623 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3624 | R: <stream:features> | ||
3625 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> | ||
3626 | </stream:features> | ||
3627 | </pre></div> | ||
3628 | <a name="sasl-errors"></a><br /><hr /> | ||
3629 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3630 | <a name="rfc.section.6.5"></a><h3>6.5. | ||
3631 | SASL Errors</h3> | ||
3632 | |||
3633 | <p>The syntax of SASL errors is as follows, where the XML data shown within the square brackets '[' and ']' is OPTIONAL. | ||
3634 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3635 | <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3636 | <defined-condition/> | ||
3637 | [<text xml:lang='langcode'> | ||
3638 | OPTIONAL descriptive text | ||
3639 | </text>] | ||
3640 | </failure> | ||
3641 | </pre></div> | ||
3642 | <p>The "defined-condition" MUST be one of the SASL-related error conditions defined in the following sections. However, because additional error conditions might be defined in the future, if an entity receives a SASL error condition that it does not understand then it MUST treat the unknown condition as a generic authentication failure, i.e., as equivalent to <not-authorized/> (<a class='info' href='#sasl-errors-not-authorized'>Section 6.5.10<span> (</span><span class='info'>not-authorized</span><span>)</span></a>). | ||
3643 | </p> | ||
3644 | <p>Inclusion of the <text/> element is OPTIONAL, and can be used to provide application-specific information about the error condition, which information MAY be displayed to a human but only as a supplement to the defined condition. | ||
3645 | </p> | ||
3646 | <p>Because XMPP itself defines an application profile of SASL and there is no expectation that more specialized XMPP applications will be built on top of SASL, the SASL error format does not provide extensibility for application-specific error conditions as is done for XML streams (<a class='info' href='#streams-error-app'>Section 4.9.4<span> (</span><span class='info'>Application-Specific Conditions</span><span>)</span></a>) and XML stanzas (<a class='info' href='#stanzas-error-app'>Section 8.3.4<span> (</span><span class='info'>Application-Specific Conditions</span><span>)</span></a>). | ||
3647 | </p> | ||
3648 | <a name="sasl-errors-aborted"></a><br /><hr /> | ||
3649 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3650 | <a name="rfc.section.6.5.1"></a><h3>6.5.1. | ||
3651 | aborted</h3> | ||
3652 | |||
3653 | <p>The receiving entity acknowledges that the authentication handshake has been aborted by the initiating entity; sent in reply to the <abort/> element. | ||
3654 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3655 | I: <abort xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> | ||
3656 | |||
3657 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3658 | <aborted/> | ||
3659 | </failure> | ||
3660 | </pre></div> | ||
3661 | <a name="sasl-errors-account-disabled"></a><br /><hr /> | ||
3662 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3663 | <a name="rfc.section.6.5.2"></a><h3>6.5.2. | ||
3664 | account-disabled</h3> | ||
3665 | |||
3666 | <p>The account of the initiating entity has been temporarily disabled; sent in reply to an <auth/> element (with or without initial response data) or a <response/> element. | ||
3667 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3668 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3669 | mechanism='PLAIN'>AGp1bGlldAByMG0zMG15cjBtMzA=</auth> | ||
3670 | |||
3671 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3672 | <account-disabled/> | ||
3673 | <text xml:lang='en'>Call 212-555-1212 for assistance.</text> | ||
3674 | </failure> | ||
3675 | </pre></div> | ||
3676 | <a name="sasl-errors-credentials-expired"></a><br /><hr /> | ||
3677 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3678 | <a name="rfc.section.6.5.3"></a><h3>6.5.3. | ||
3679 | credentials-expired</h3> | ||
3680 | |||
3681 | <p>The authentication failed because the initiating entity provided credentials that have expired; sent in reply to a <response/> element or an <auth/> element with initial response data. | ||
3682 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3683 | I: <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3684 | [ ... ] | ||
3685 | </response> | ||
3686 | |||
3687 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3688 | <credentials-expired/> | ||
3689 | </failure> | ||
3690 | </pre></div> | ||
3691 | <a name="sasl-errors-encryption-required"></a><br /><hr /> | ||
3692 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3693 | <a name="rfc.section.6.5.4"></a><h3>6.5.4. | ||
3694 | encryption-required</h3> | ||
3695 | |||
3696 | <p>The mechanism requested by the initiating entity cannot be used unless the confidentiality and integrity of the underlying stream are protected (typically via TLS); sent in reply to an <auth/> element (with or without initial response data). | ||
3697 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3698 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3699 | mechanism='PLAIN'>AGp1bGlldAByMG0zMG15cjBtMzA=</auth> | ||
3700 | |||
3701 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3702 | <encryption-required/> | ||
3703 | </failure> | ||
3704 | </pre></div> | ||
3705 | <a name="sasl-errors-incorrect-encoding"></a><br /><hr /> | ||
3706 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3707 | <a name="rfc.section.6.5.5"></a><h3>6.5.5. | ||
3708 | incorrect-encoding</h3> | ||
3709 | |||
3710 | <p>The data provided by the initiating entity could not be processed because the base 64 encoding is incorrect (e.g., because the encoding does not adhere to the definition in Section 4 of <a class='info' href='#BASE64'>[BASE64]<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a>); sent in reply to a <response/> element or an <auth/> element with initial response data. | ||
3711 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3712 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3713 | mechanism='DIGEST-MD5'>[ ... ]</auth> | ||
3714 | |||
3715 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3716 | <incorrect-encoding/> | ||
3717 | </failure> | ||
3718 | </pre></div> | ||
3719 | <a name="sasl-errors-invalid-authzid"></a><br /><hr /> | ||
3720 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3721 | <a name="rfc.section.6.5.6"></a><h3>6.5.6. | ||
3722 | invalid-authzid</h3> | ||
3723 | |||
3724 | <p>The authzid provided by the initiating entity is invalid, either because it is incorrectly formatted or because the initiating entity does not have permissions to authorize that ID; sent in reply to a <response/> element or an <auth/> element with initial response data. | ||
3725 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3726 | I: <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3727 | [ ... ] | ||
3728 | </response> | ||
3729 | |||
3730 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3731 | <invalid-authzid/> | ||
3732 | </failure> | ||
3733 | </pre></div> | ||
3734 | <a name="sasl-errors-invalid-mechanism"></a><br /><hr /> | ||
3735 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3736 | <a name="rfc.section.6.5.7"></a><h3>6.5.7. | ||
3737 | invalid-mechanism</h3> | ||
3738 | |||
3739 | <p>The initiating entity did not specify a mechanism, or requested a mechanism that is not supported by the receiving entity; sent in reply to an <auth/> element. | ||
3740 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3741 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3742 | mechanism='CRAM-MD5'/> | ||
3743 | |||
3744 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3745 | <invalid-mechanism/> | ||
3746 | </failure> | ||
3747 | </pre></div> | ||
3748 | <a name="sasl-errors-malformed-request"></a><br /><hr /> | ||
3749 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3750 | <a name="rfc.section.6.5.8"></a><h3>6.5.8. | ||
3751 | malformed-request</h3> | ||
3752 | |||
3753 | <p>The request is malformed (e.g., the <auth/> element includes initial response data but the mechanism does not allow that, or the data sent violates the syntax for the specified SASL mechanism); sent in reply to an <abort/>, <auth/>, <challenge/>, or <response/> element. | ||
3754 | </p> | ||
3755 | <p>(In the following example, the XML character data of the <auth/> element contains more than 255 UTF-8-encoded Unicode characters and therefore violates the "token" production for the SASL ANONYMOUS mechanism as specified in <a class='info' href='#ANONYMOUS'>[ANONYMOUS]<span> (</span><span class='info'>Zeilenga, K., “Anonymous Simple Authentication and Security Layer (SASL) Mechanism,” June 2006.</span><span>)</span></a>.) | ||
3756 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3757 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3758 | mechanism='ANONYMOUS'>[ ... some-long-token ... ]</auth> | ||
3759 | |||
3760 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3761 | <malformed-request/> | ||
3762 | </failure> | ||
3763 | </pre></div> | ||
3764 | <a name="sasl-errors-mechanism-too-weak"></a><br /><hr /> | ||
3765 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3766 | <a name="rfc.section.6.5.9"></a><h3>6.5.9. | ||
3767 | mechanism-too-weak</h3> | ||
3768 | |||
3769 | <p>The mechanism requested by the initiating entity is weaker than server policy permits for that initiating entity; sent in reply to an <auth/> element (with or without initial response data). | ||
3770 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3771 | I: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
3772 | mechanism='PLAIN'>AGp1bGlldAByMG0zMG15cjBtMzA=</auth> | ||
3773 | |||
3774 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3775 | <mechanism-too-weak/> | ||
3776 | </failure> | ||
3777 | </pre></div> | ||
3778 | <a name="sasl-errors-not-authorized"></a><br /><hr /> | ||
3779 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3780 | <a name="rfc.section.6.5.10"></a><h3>6.5.10. | ||
3781 | not-authorized</h3> | ||
3782 | |||
3783 | <p>The authentication failed because the initiating entity did not provide proper credentials, or because some generic authentication failure has occurred but the receiving entity does not wish to disclose specific information about the cause of the failure; sent in reply to a <response/> element or an <auth/> element with initial response data. | ||
3784 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3785 | I: <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3786 | [ ... ] | ||
3787 | </response> | ||
3788 | |||
3789 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3790 | <not-authorized/> | ||
3791 | </failure> | ||
3792 | </pre></div> | ||
3793 | <p></p> | ||
3794 | <blockquote class="text"> | ||
3795 | <p>Security Warning: This error condition includes but is not limited to the case of incorrect credentials or a nonexistent username. In order to discourage directory harvest attacks, no differentiation is made between incorrect credentials and a nonexistent username. | ||
3796 | </p> | ||
3797 | </blockquote> | ||
3798 | |||
3799 | <a name="sasl-errors-temporary-auth-failure"></a><br /><hr /> | ||
3800 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3801 | <a name="rfc.section.6.5.11"></a><h3>6.5.11. | ||
3802 | temporary-auth-failure</h3> | ||
3803 | |||
3804 | <p>The authentication failed because of a temporary error condition within the receiving entity, and it is advisable for the initiating entity to try again later; sent in reply to an <auth/> element or a <response/> element. | ||
3805 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3806 | I: <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3807 | [ ... ] | ||
3808 | </response> | ||
3809 | |||
3810 | R: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
3811 | <temporary-auth-failure/> | ||
3812 | </failure> | ||
3813 | </pre></div> | ||
3814 | <a name="sasl-def"></a><br /><hr /> | ||
3815 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3816 | <a name="rfc.section.6.6"></a><h3>6.6. | ||
3817 | SASL Definition</h3> | ||
3818 | |||
3819 | <p>The profiling requirements of <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a> require that the | ||
3820 | following information be supplied by the definition of a using protocol. | ||
3821 | </p> | ||
3822 | <p></p> | ||
3823 | <blockquote class="text"><dl> | ||
3824 | <dt>service name:</dt> | ||
3825 | <dd>"xmpp" | ||
3826 | </dd> | ||
3827 | <dt>initiation sequence:</dt> | ||
3828 | <dd>After the initiating entity provides | ||
3829 | an opening XML stream header and the receiving entity replies in kind, the | ||
3830 | receiving entity provides a list of acceptable authentication methods. The | ||
3831 | initiating entity chooses one method from the list and sends it to the | ||
3832 | receiving entity as the value of the 'mechanism' attribute possessed by an | ||
3833 | <auth/> element, optionally including an initial response to avoid a | ||
3834 | round trip. | ||
3835 | </dd> | ||
3836 | <dt>exchange sequence:</dt> | ||
3837 | <dd>Challenges and responses are carried | ||
3838 | through the exchange of <challenge/> elements from receiving entity to | ||
3839 | initiating entity and <response/> elements from initiating entity to | ||
3840 | receiving entity. The receiving entity reports failure by sending a | ||
3841 | <failure/> element and success by sending a <success/> element; the | ||
3842 | initiating entity aborts the exchange by sending an <abort/> element. | ||
3843 | Upon successful negotiation, both sides consider the original XML stream to be | ||
3844 | closed and new stream headers are sent by both entities. | ||
3845 | </dd> | ||
3846 | <dt>security layer negotiation:</dt> | ||
3847 | <dd>The security layer takes | ||
3848 | effect immediately after sending the closing '>' character of the | ||
3849 | <success/> element for the receiving entity, and immediately after | ||
3850 | receiving the closing '>' character of the <success/> element for the | ||
3851 | initiating entity. The order of layers is first <a class='info' href='#TCP'>[TCP]<span> (</span><span class='info'>Postel, J., “Transmission Control Protocol,” September 1981.</span><span>)</span></a>, then | ||
3852 | <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>, then <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>, then XMPP. | ||
3853 | </dd> | ||
3854 | <dt>use of the authorization identity:</dt> | ||
3855 | <dd>The authorization | ||
3856 | identity can be used in XMPP to denote the non-default | ||
3857 | <localpart@domainpart> of a client; an empty string is equivalent to an | ||
3858 | absent authorization identity. | ||
3859 | </dd> | ||
3860 | </dl></blockquote> | ||
3861 | |||
3862 | <a name="bind"></a><br /><hr /> | ||
3863 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3864 | <a name="rfc.section.7"></a><h3>7. | ||
3865 | Resource Binding</h3> | ||
3866 | |||
3867 | <a name="bind-fundamentals"></a><br /><hr /> | ||
3868 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3869 | <a name="rfc.section.7.1"></a><h3>7.1. | ||
3870 | Fundamentals</h3> | ||
3871 | |||
3872 | <p>After a client authenticates with a server, it MUST bind a specific resource to the stream so that the server can properly address the client. That is, there MUST be an XMPP resource associated with the bare JID (<localpart@domainpart>) of the client, so that the address for use over that stream is a full JID of the form <localpart@domainpart/resource> (including the resourcepart). This ensures that the server can deliver XML stanzas to and receive XML stanzas from the client in relation to entities other than the server itself or the client's account, as explained under <a class='info' href='#rules'>Section 10<span> (</span><span class='info'>Server Rules for Processing XML Stanzas</span><span>)</span></a>. | ||
3873 | </p> | ||
3874 | <p></p> | ||
3875 | <blockquote class="text"> | ||
3876 | <p>Informational Note: The client could exchange stanzas with the server itself or the client's account before binding a resource since the full JID is needed only for addressing outside the context of the stream negotiated between the client and the server, but this is not commonly done. | ||
3877 | </p> | ||
3878 | </blockquote> | ||
3879 | |||
3880 | <p>After a client has bound a resource to the stream, it is referred to as a "connected resource". A server SHOULD allow an entity to maintain multiple connected resources simultaneously, where each connected resource is associated with a distinct XML stream and is differentiated from the other connected resources by a distinct resourcepart. | ||
3881 | </p> | ||
3882 | <p></p> | ||
3883 | <blockquote class="text"> | ||
3884 | <p>Security Warning: A server SHOULD enable the administrator of an XMPP service to limit the number of connected resources in order to prevent certain denial-of-service attacks as described under <a class='info' href='#security-dos'>Section 13.12<span> (</span><span class='info'>Denial of Service</span><span>)</span></a>. | ||
3885 | </p> | ||
3886 | </blockquote> | ||
3887 | |||
3888 | <p>If, before completing the resource binding step, the client attempts to send an XML stanza to an entity other than the server itself or the client's account, the server MUST NOT process the stanza and MUST close the stream with a <not-authorized/> stream error (<a class='info' href='#streams-error-conditions-not-authorized'>Section 4.9.3.12<span> (</span><span class='info'>not-authorized</span><span>)</span></a>). | ||
3889 | </p> | ||
3890 | <p>The XML namespace name for the resource binding extension is 'urn:ietf:params:xml:ns:xmpp-bind'. | ||
3891 | </p> | ||
3892 | <a name="bind-support"></a><br /><hr /> | ||
3893 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3894 | <a name="rfc.section.7.2"></a><h3>7.2. | ||
3895 | Support</h3> | ||
3896 | |||
3897 | <p>Support for resource binding is REQUIRED in XMPP client and server implementations. | ||
3898 | </p> | ||
3899 | <a name="bind-rules"></a><br /><hr /> | ||
3900 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3901 | <a name="rfc.section.7.3"></a><h3>7.3. | ||
3902 | Stream Negotiation Rules</h3> | ||
3903 | |||
3904 | <a name="bind-rules-mtn"></a><br /><hr /> | ||
3905 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3906 | <a name="rfc.section.7.3.1"></a><h3>7.3.1. | ||
3907 | Mandatory-to-Negotiate</h3> | ||
3908 | |||
3909 | <p>The parties to a stream MUST consider resource binding as mandatory-to-negotiate. | ||
3910 | </p> | ||
3911 | <a name="bind-rules-restart"></a><br /><hr /> | ||
3912 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3913 | <a name="rfc.section.7.3.2"></a><h3>7.3.2. | ||
3914 | Restart</h3> | ||
3915 | |||
3916 | <p>After resource binding, the parties MUST NOT restart the stream. | ||
3917 | </p> | ||
3918 | <a name="bind-feature"></a><br /><hr /> | ||
3919 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3920 | <a name="rfc.section.7.4"></a><h3>7.4. | ||
3921 | Advertising Support</h3> | ||
3922 | |||
3923 | <p>Upon sending a new response stream header to the client after successful SASL negotiation, the server MUST include a <bind/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace in the stream features it presents to the client. | ||
3924 | </p> | ||
3925 | <p>The server MUST NOT include the resource binding stream feature until after the client has authenticated, typically by means of successful SASL negotiation. | ||
3926 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3927 | S: <stream:stream | ||
3928 | from='im.example.com' | ||
3929 | id='gPybzaOzBmaADgxKXu9UClbprp0=' | ||
3930 | to='juliet@im.example.com' | ||
3931 | version='1.0' | ||
3932 | xml:lang='en' | ||
3933 | xmlns='jabber:client' | ||
3934 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
3935 | |||
3936 | S: <stream:features> | ||
3937 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> | ||
3938 | </stream:features> | ||
3939 | </pre></div> | ||
3940 | <p>Upon being informed that resource binding is mandatory-to-negotiate, the client MUST bind a resource to the stream as described in the following sections. | ||
3941 | </p> | ||
3942 | <a name="bind-generation"></a><br /><hr /> | ||
3943 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3944 | <a name="rfc.section.7.5"></a><h3>7.5. | ||
3945 | Generation of Resource Identifiers</h3> | ||
3946 | |||
3947 | <p>A resourcepart MUST at a minimum be unique among the connected resources for that <localpart@domainpart>. Enforcement of this policy is the responsibility of the server. | ||
3948 | </p> | ||
3949 | <p></p> | ||
3950 | <blockquote class="text"> | ||
3951 | <p>Security Warning: A resourcepart can be security-critical. For example, if a malicious entity can guess a client's resourcepart then it might be able to determine if the client (and therefore the controlling principal) is online or offline, thus resulting in a presence leak as described under <a class='info' href='#security-leaks-presence'>Section 13.10.2<span> (</span><span class='info'>Presence Information</span><span>)</span></a>. To prevent that possibility, a client can either (1) generate a random resourcepart on its own or (2) ask the server to generate a resourcepart on its behalf. One method for ensuring that the resourcepart is random is to generate a Universally Unique Identifier (UUID) as specified in <a class='info' href='#UUID'>[UUID]<span> (</span><span class='info'>Leach, P., Mealling, M., and R. Salz, “A Universally Unique IDentifier (UUID) URN Namespace,” July 2005.</span><span>)</span></a>. | ||
3952 | </p> | ||
3953 | </blockquote> | ||
3954 | |||
3955 | <a name="bind-servergen"></a><br /><hr /> | ||
3956 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3957 | <a name="rfc.section.7.6"></a><h3>7.6. | ||
3958 | Server-Generated Resource Identifier</h3> | ||
3959 | |||
3960 | <p>A server MUST be able to generate an XMPP resourcepart on behalf of a client. The resourcepart generated by the server MUST be random (see <a class='info' href='#RANDOM'>[RANDOM]<span> (</span><span class='info'>Eastlake, D., Schiller, J., and S. Crocker, “Randomness Requirements for Security,” June 2005.</span><span>)</span></a>). | ||
3961 | </p> | ||
3962 | <a name="bind-servergen-success"></a><br /><hr /> | ||
3963 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3964 | <a name="rfc.section.7.6.1"></a><h3>7.6.1. | ||
3965 | Success Case</h3> | ||
3966 | |||
3967 | <p>A client requests a server-generated resourcepart by sending an IQ stanza of type "set" (see <a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>) containing an empty <bind/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace. | ||
3968 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3969 | C: <iq id='tn281v37' type='set'> | ||
3970 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> | ||
3971 | </iq> | ||
3972 | </pre></div> | ||
3973 | <p>Once the server has generated an XMPP resourcepart for the client, it MUST return an IQ stanza of type "result" to the client, which MUST include a <jid/> child element that specifies the full JID for the connected resource as determined by the server. | ||
3974 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
3975 | S: <iq id='tn281v37' type='result'> | ||
3976 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
3977 | <jid> | ||
3978 | juliet@im.example.com/4db06f06-1ea4-11dc-aca3-000bcd821bfb | ||
3979 | </jid> | ||
3980 | </bind> | ||
3981 | </iq> | ||
3982 | </pre></div> | ||
3983 | <a name="bind-servergen-error"></a><br /><hr /> | ||
3984 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
3985 | <a name="rfc.section.7.6.2"></a><h3>7.6.2. | ||
3986 | Error Cases</h3> | ||
3987 | |||
3988 | <p>When a client asks the server to generate a resourcepart during resource binding, the following stanza error conditions are defined: | ||
3989 | </p> | ||
3990 | <p> | ||
3991 | </p> | ||
3992 | <ul class="text"> | ||
3993 | <li>The account has reached a limit on the number of simultaneous connected resources allowed. | ||
3994 | </li> | ||
3995 | <li>The client is otherwise not allowed to bind a resource to the stream. | ||
3996 | </li> | ||
3997 | </ul><p> | ||
3998 | |||
3999 | </p> | ||
4000 | <p>Naturally, it is possible that error conditions not specified here might occur, as described under <a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a>. | ||
4001 | </p> | ||
4002 | <a name="bind-servergen-error-resourceconstraint"></a><br /><hr /> | ||
4003 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4004 | <a name="rfc.section.7.6.2.1"></a><h3>7.6.2.1. | ||
4005 | Resource Constraint</h3> | ||
4006 | |||
4007 | <p>If the account has reached a limit on the number of simultaneous connected resources allowed, the server MUST return a <resource-constraint/> stanza error (<a class='info' href='#stanzas-error-conditions-resource-constraint'>Section 8.3.3.18<span> (</span><span class='info'>resource-constraint</span><span>)</span></a>). | ||
4008 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4009 | S: <iq id='tn281v37' type='error'> | ||
4010 | <error type='wait'> | ||
4011 | <resource-constraint | ||
4012 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4013 | </error> | ||
4014 | </iq> | ||
4015 | </pre></div> | ||
4016 | <a name="bind-servergen-error-notallowed"></a><br /><hr /> | ||
4017 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4018 | <a name="rfc.section.7.6.2.2"></a><h3>7.6.2.2. | ||
4019 | Not Allowed</h3> | ||
4020 | |||
4021 | <p>If the client is otherwise not allowed to bind a resource to the stream, the server MUST return a <not-allowed/> stanza error (<a class='info' href='#stanzas-error-conditions-not-allowed'>Section 8.3.3.10<span> (</span><span class='info'>not-allowed</span><span>)</span></a>). | ||
4022 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4023 | S: <iq id='tn281v37' type='error'> | ||
4024 | <error type='cancel'> | ||
4025 | <not-allowed | ||
4026 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4027 | </error> | ||
4028 | </iq> | ||
4029 | </pre></div> | ||
4030 | <a name="bind-clientsubmit"></a><br /><hr /> | ||
4031 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4032 | <a name="rfc.section.7.7"></a><h3>7.7. | ||
4033 | Client-Submitted Resource Identifier</h3> | ||
4034 | |||
4035 | <p>Instead of asking the server to generate a resourcepart on its behalf, a client MAY attempt to submit a resourcepart that it has generated or that the controlling user has provided. | ||
4036 | </p> | ||
4037 | <a name="bind-clientsubmit-success"></a><br /><hr /> | ||
4038 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4039 | <a name="rfc.section.7.7.1"></a><h3>7.7.1. | ||
4040 | Success Case</h3> | ||
4041 | |||
4042 | <p>A client asks its server to accept a client-submitted resourcepart by sending an IQ stanza of type "set" containing a <bind/> element with a child <resource/> element containing non-zero-length XML character data. | ||
4043 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4044 | C: <iq id='wy2xa82b4' type='set'> | ||
4045 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4046 | <resource>balcony</resource> | ||
4047 | </bind> | ||
4048 | </iq> | ||
4049 | </pre></div> | ||
4050 | <p>The server SHOULD accept the client-submitted resourcepart. It does so by returning an IQ stanza of type "result" to the client, including a <jid/> child element that specifies the full JID for the connected resource and contains without modification the client-submitted text. | ||
4051 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4052 | S: <iq id='wy2xa82b4' type='result'> | ||
4053 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4054 | <jid>juliet@im.example.com/balcony</jid> | ||
4055 | </bind> | ||
4056 | </iq> | ||
4057 | </pre></div> | ||
4058 | <p>Alternatively, in accordance with local service policies the server MAY refuse the client-submitted resourcepart and override it with a resourcepart that the server generates. | ||
4059 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4060 | S: <iq id='wy2xa82b4' type='result'> | ||
4061 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4062 | <jid> | ||
4063 | juliet@im.example.com/balcony 4db06f06-1ea4-11dc-aca3-000bcd821bfb | ||
4064 | </jid> | ||
4065 | </bind> | ||
4066 | </iq> | ||
4067 | </pre></div> | ||
4068 | <a name="bind-clientsubmit-error"></a><br /><hr /> | ||
4069 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4070 | <a name="rfc.section.7.7.2"></a><h3>7.7.2. | ||
4071 | Error Cases</h3> | ||
4072 | |||
4073 | <p>When a client attempts to submit its own XMPP resourcepart during resource binding, the following stanza error conditions are defined in addition to those described under <a class='info' href='#bind-servergen-error'>Section 7.6.2<span> (</span><span class='info'>Error Cases</span><span>)</span></a>: | ||
4074 | </p> | ||
4075 | <p> | ||
4076 | </p> | ||
4077 | <ul class="text"> | ||
4078 | <li>The provided resourcepart cannot be processed by the server. | ||
4079 | </li> | ||
4080 | <li>The provided resourcepart is already in use. | ||
4081 | </li> | ||
4082 | </ul><p> | ||
4083 | |||
4084 | </p> | ||
4085 | <p>Naturally, it is possible that error conditions not specified here might occur, as described under <a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a>. | ||
4086 | </p> | ||
4087 | <a name="bind-clientsubmit-error-badrequest"></a><br /><hr /> | ||
4088 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4089 | <a name="rfc.section.7.7.2.1"></a><h3>7.7.2.1. | ||
4090 | Bad Request</h3> | ||
4091 | |||
4092 | <p>If the provided resourcepart cannot be processed by the server (e.g., because it is of zero length or because it otherwise violates the rules for resourceparts specified in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>), the server can return a <bad-request/> stanza error (<a class='info' href='#stanzas-error-conditions-bad-request'>Section 8.3.3.1<span> (</span><span class='info'>bad-request</span><span>)</span></a>) but SHOULD instead process the resourcepart so that it is in conformance. | ||
4093 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4094 | S: <iq id='wy2xa82b4' type='error'> | ||
4095 | <error type='modify'> | ||
4096 | <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4097 | </error> | ||
4098 | </iq> | ||
4099 | </pre></div> | ||
4100 | <a name="bind-clientsubmit-error-conflict"></a><br /><hr /> | ||
4101 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4102 | <a name="rfc.section.7.7.2.2"></a><h3>7.7.2.2. | ||
4103 | Conflict</h3> | ||
4104 | |||
4105 | <p>If there is a currently connected client whose session | ||
4106 | has the resourcepart being requested by the newly connecting client, the server MUST do one of the following (which of these the server does is a matter for implementation or local service policy, although suggestions are provided below). | ||
4107 | </p> | ||
4108 | <p> | ||
4109 | </p> | ||
4110 | <ol class="text"> | ||
4111 | <li>Override the resourcepart provided by the newly connecting client with a server-generated resourcepart. | ||
4112 | |||
4113 | This behavior is encouraged, because it simplifies the resource binding process for client implementations. | ||
4114 | </li> | ||
4115 | <li>Disallow the resource binding attempt of the newly | ||
4116 | connecting client and maintain the session of the | ||
4117 | currently connected client. | ||
4118 | |||
4119 | This behavior is neither encouraged nor discouraged, despite the fact that it was implicitly encouraged in RFC 3920; however, note that handling of the <conflict/> error is unevenly supported among existing client implementations, which often treat it as an authentication error and have been observed to discard cached credentials when receiving it. | ||
4120 | </li> | ||
4121 | <li>Terminate the session of the currently connected | ||
4122 | client and allow the resource binding attempt of the | ||
4123 | newly connecting client. | ||
4124 | |||
4125 | Although this was the traditional behavior of early XMPP | ||
4126 | server implementations, it is now discouraged because it | ||
4127 | can lead to a never-ending cycle of two clients | ||
4128 | effectively disconnecting each other; however, note that | ||
4129 | this behavior can be appropriate in some deployment | ||
4130 | scenarios or if the server knows that the currently connected client has a dead connection or broken stream as described under <a class='info' href='#streams-silence'>Section 4.6<span> (</span><span class='info'>Handling of Silent Peers</span><span>)</span></a>. | ||
4131 | </li> | ||
4132 | </ol><p> | ||
4133 | |||
4134 | </p> | ||
4135 | <p>If the server follows behavior #1, it returns an | ||
4136 | <iq/> stanza of type "result" to the newly connecting client, where the <jid/> child of the <bind/> element contains XML character data that indicates the full JID of the client, including the resourcepart that was generated by the server. | ||
4137 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4138 | S: <iq id='wy2xa82b4' type='result'> | ||
4139 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4140 | <jid> | ||
4141 | juliet@im.example.com/balcony 4db06f06-1ea4-11dc-aca3-000bcd821bfb | ||
4142 | </jid> | ||
4143 | </bind> | ||
4144 | </iq> | ||
4145 | </pre></div> | ||
4146 | <p>If the server follows behavior #2, it sends a <conflict/> stanza error (<a class='info' href='#stanzas-error-conditions-conflict'>Section 8.3.3.2<span> (</span><span class='info'>conflict</span><span>)</span></a>) in response to the resource binding attempt of the newly connecting client but maintains the XML stream so that the newly connecting client has an opportunity to negotiate a non-conflicting resourcepart (i.e., the newly connecting client needs to choose a different resourcepart before making another attempt to bind a resource). | ||
4147 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4148 | S: <iq id='wy2xa82b4' type='error'> | ||
4149 | <error type='modify'> | ||
4150 | <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4151 | </error> | ||
4152 | </iq> | ||
4153 | </pre></div> | ||
4154 | <p>If the server follows behavior #3, it returns a <conflict/> stream error (<a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>) to the currently connected client (as described under <a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>) and returns an IQ stanza of type "result" (indicating success) in response to the resource binding attempt of the newly connecting client. | ||
4155 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4156 | S: <iq id='wy2xa82b4' type='result'> | ||
4157 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4158 | <jid> | ||
4159 | juliet@im.example.com/balcony | ||
4160 | </jid> | ||
4161 | </bind> | ||
4162 | </iq> | ||
4163 | </pre></div> | ||
4164 | <a name="bind-clientsubmit-retries"></a><br /><hr /> | ||
4165 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4166 | <a name="rfc.section.7.7.3"></a><h3>7.7.3. | ||
4167 | Retries</h3> | ||
4168 | |||
4169 | <p>If an error occurs when a client submits a resourcepart, the server SHOULD allow a configurable but reasonable number of retries (at least 5 and no more than 10); this enables the client to tolerate incorrectly provided resourceparts (e.g., bad data formats or duplicate text strings) without being forced to reconnect. | ||
4170 | </p> | ||
4171 | <p>After the client has reached the retry limit, the server MUST close the stream with a <policy-violation/> stream error (<a class='info' href='#streams-error-conditions-policy-violation'>Section 4.9.3.14<span> (</span><span class='info'>policy-violation</span><span>)</span></a>). | ||
4172 | </p> | ||
4173 | <a name="stanzas"></a><br /><hr /> | ||
4174 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4175 | <a name="rfc.section.8"></a><h3>8. | ||
4176 | XML Stanzas</h3> | ||
4177 | |||
4178 | <p>After a client and a server (or two servers) have completed stream negotiation, either party can send XML stanzas. Three kinds of XML stanza are defined for the 'jabber:client' and 'jabber:server' namespaces: <message/>, <presence/>, and <iq/>. In addition, there are five common attributes for these stanza types. These common attributes, as well as the basic semantics of the three stanza types, are defined in this specification; more detailed information regarding the syntax of XML stanzas for instant messaging and presence applications is provided in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>, and for other applications in the relevant XMPP extension specifications. | ||
4179 | </p> | ||
4180 | <p>Support for the XML stanza syntax and semantics defined in this specification is REQUIRED in XMPP client and server implementations. | ||
4181 | </p> | ||
4182 | <p></p> | ||
4183 | <blockquote class="text"> | ||
4184 | <p>Security Warning: A server MUST NOT process a partial stanza and MUST NOT attach meaning to the transmission timing of any part of a stanza (before receipt of the closing tag). | ||
4185 | </p> | ||
4186 | </blockquote> | ||
4187 | |||
4188 | <a name="stanzas-attributes"></a><br /><hr /> | ||
4189 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4190 | <a name="rfc.section.8.1"></a><h3>8.1. | ||
4191 | Common Attributes</h3> | ||
4192 | |||
4193 | <p>The following five attributes are common to message, presence, and IQ stanzas. | ||
4194 | </p> | ||
4195 | <a name="stanzas-attributes-to"></a><br /><hr /> | ||
4196 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4197 | <a name="rfc.section.8.1.1"></a><h3>8.1.1. | ||
4198 | to</h3> | ||
4199 | |||
4200 | <p>The 'to' attribute specifies the JID of the intended recipient for the stanza. | ||
4201 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4202 | <message to='romeo@example.net'> | ||
4203 | <body>Art thou not Romeo, and a Montague?</body> | ||
4204 | </message> | ||
4205 | </pre></div> | ||
4206 | <p>For information about server processing of inbound and outbound XML stanzas based on the 'to' address, refer to <a class='info' href='#rules'>Section 10<span> (</span><span class='info'>Server Rules for Processing XML Stanzas</span><span>)</span></a>. | ||
4207 | </p> | ||
4208 | <a name="stanzas-attributes-to-c2s"></a><br /><hr /> | ||
4209 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4210 | <a name="rfc.section.8.1.1.1"></a><h3>8.1.1.1. | ||
4211 | Client-to-Server Streams</h3> | ||
4212 | |||
4213 | <p>The following rules apply to inclusion of the 'to' attribute in stanzas sent from a connected client to its server over an XML stream qualified by the 'jabber:client' namespace. | ||
4214 | </p> | ||
4215 | <p> | ||
4216 | </p> | ||
4217 | <ol class="text"> | ||
4218 | <li>A stanza with a specific intended recipient (e.g., a conversation partner, a remote service, the server itself, even another resource associated with the user's bare JID) MUST possess a 'to' attribute whose value is an XMPP address. | ||
4219 | </li> | ||
4220 | <li>A stanza sent from a client to a server for direct processing by the server (e.g., roster processing as described in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a> or presence sent to the server for broadcasting to other entities) MUST NOT possess a 'to' attribute. | ||
4221 | </li> | ||
4222 | </ol><p> | ||
4223 | |||
4224 | </p> | ||
4225 | <p>The following rules apply to inclusion of the 'to' attribute in stanzas sent from a server to a connected client over an XML stream qualified by the 'jabber:client' namespace. | ||
4226 | </p> | ||
4227 | <p> | ||
4228 | </p> | ||
4229 | <ol class="text"> | ||
4230 | <li>If the server has received the stanza from another connected client or from a peer server, the server MUST NOT modify the 'to' address before delivering the stanza to the client. | ||
4231 | </li> | ||
4232 | <li>If the server has itself generated the stanza (e.g., a response to an IQ stanza of type "get" or "set", even if the stanza did not include a 'to' address), the stanza MAY include a 'to' address, which MUST be the full JID of the client; however, if the stanza does not include a 'to' address then the client MUST treat it as if the 'to' address were included with a value of the client's full JID. | ||
4233 | </li> | ||
4234 | </ol><p> | ||
4235 | |||
4236 | </p> | ||
4237 | <p></p> | ||
4238 | <blockquote class="text"> | ||
4239 | <p>Implementation Note: It is the server's responsibility to deliver only stanzas that are addressed to the client's full JID or the user's bare JID; thus, there is no need for the client to check the 'to' address of incoming stanzas. However, if the client does check the 'to' address then it is suggested to check at most the bare JID portion (not the full JID), since the 'to' address might be the user's bare JID, the client's current full JID, or even a full JID with a different resourcepart (e.g., in the case of so-called "offline messages" as described in <a class='info' href='#XEP-0160'>[XEP‑0160]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices for Handling Offline Messages,” January 2006.</span><span>)</span></a>). | ||
4240 | </p> | ||
4241 | </blockquote> | ||
4242 | |||
4243 | <a name="stanzas-attributes-to-s2s"></a><br /><hr /> | ||
4244 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4245 | <a name="rfc.section.8.1.1.2"></a><h3>8.1.1.2. | ||
4246 | Server-to-Server Streams</h3> | ||
4247 | |||
4248 | <p>The following rules apply to inclusion of the 'to' attribute in the context of XML streams qualified by the 'jabber:server' namespace (i.e., server-to-server streams). | ||
4249 | </p> | ||
4250 | <p> | ||
4251 | </p> | ||
4252 | <ol class="text"> | ||
4253 | <li>A stanza MUST possess a 'to' attribute whose value is an XMPP address; if a server receives a stanza that does not meet this restriction, it MUST close the stream with an <improper-addressing/> stream error (<a class='info' href='#streams-error-conditions-improper-addressing'>Section 4.9.3.7<span> (</span><span class='info'>improper-addressing</span><span>)</span></a>). | ||
4254 | </li> | ||
4255 | <li>The domainpart of the JID contained in the stanza's 'to' attribute MUST match the FQDN of the receiving server (or any validated domain thereof) as communicated via SASL negotiation (see <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>), Server Dialback (see <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>), or similar means; if a server receives a stanza that does not meet this restriction, it MUST close the stream with a <host-unknown/> stream error (<a class='info' href='#streams-error-conditions-host-unknown'>Section 4.9.3.6<span> (</span><span class='info'>host-unknown</span><span>)</span></a>) or a <host-gone/> stream error (<a class='info' href='#streams-error-conditions-host-gone'>Section 4.9.3.5<span> (</span><span class='info'>host-gone</span><span>)</span></a>). | ||
4256 | </li> | ||
4257 | </ol><p> | ||
4258 | |||
4259 | </p> | ||
4260 | <a name="stanzas-attributes-from"></a><br /><hr /> | ||
4261 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4262 | <a name="rfc.section.8.1.2"></a><h3>8.1.2. | ||
4263 | from</h3> | ||
4264 | |||
4265 | <p>The 'from' attribute specifies the JID of the sender. | ||
4266 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4267 | <message from='juliet@im.example.com/balcony' | ||
4268 | to='romeo@example.net'> | ||
4269 | <body>Art thou not Romeo, and a Montague?</body> | ||
4270 | </message> | ||
4271 | </pre></div> | ||
4272 | <a name="stanzas-attributes-from-c2s"></a><br /><hr /> | ||
4273 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4274 | <a name="rfc.section.8.1.2.1"></a><h3>8.1.2.1. | ||
4275 | Client-to-Server Streams</h3> | ||
4276 | |||
4277 | <p>The following rules apply to the 'from' attribute in the context of XML streams qualified by the 'jabber:client' namespace (i.e., client-to-server streams). | ||
4278 | </p> | ||
4279 | <p> | ||
4280 | </p> | ||
4281 | <ol class="text"> | ||
4282 | <li>When a server receives an XML stanza from a connected client, the server MUST add a 'from' attribute to the stanza or override the 'from' attribute specified by the client, where the value of the 'from' attribute MUST be the full JID (<localpart@domainpart/resource>) determined by the server for the connected resource that generated the stanza (see <a class='info' href='#streams-negotiation-address'>Section 4.3.6<span> (</span><span class='info'>Determination of Addresses</span><span>)</span></a>), or the bare JID (<localpart@domainpart>) in the case of subscription-related presence stanzas (see <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
4283 | </li> | ||
4284 | <li>When the server generates a stanza on its own behalf for delivery to the client from the server itself, the stanza MUST include a 'from' attribute whose value is the bare JID (i.e., <domainpart>) of the server as agreed upon during stream negotiation (e.g., based on the 'to' attribute of the initial stream header). | ||
4285 | </li> | ||
4286 | <li>When the server generates a stanza from the server for delivery to the client on behalf of the account of the connected client (e.g., in the context of data storage services provided by the server on behalf of the client), the stanza MUST either (a) not include a 'from' attribute or (b) include a 'from' attribute whose value is the account's bare JID (<localpart@domainpart>). | ||
4287 | </li> | ||
4288 | <li>A server MUST NOT send to the client a stanza without a 'from' attribute if the stanza was not generated by the server on its own behalf (e.g., if it was generated by another client or a peer server and the server is merely delivering it to the client on behalf of some other entity); therefore, when a client receives a stanza that does not include a 'from' attribute, it MUST assume that the stanza is from the user's account on the server. | ||
4289 | </li> | ||
4290 | </ol><p> | ||
4291 | |||
4292 | </p> | ||
4293 | <a name="stanzas-attributes-from-s2s"></a><br /><hr /> | ||
4294 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4295 | <a name="rfc.section.8.1.2.2"></a><h3>8.1.2.2. | ||
4296 | Server-to-Server Streams</h3> | ||
4297 | |||
4298 | <p>The following rules apply to the 'from' attribute in the context of XML streams qualified by the 'jabber:server' namespace (i.e., server-to-server streams). | ||
4299 | </p> | ||
4300 | <p> | ||
4301 | </p> | ||
4302 | <ol class="text"> | ||
4303 | <li>A stanza MUST possess a 'from' attribute whose value is an XMPP address; if a server receives a stanza that does not meet this restriction, it MUST close the stream with an <improper-addressing/> stream error (<a class='info' href='#streams-error-conditions-improper-addressing'>Section 4.9.3.7<span> (</span><span class='info'>improper-addressing</span><span>)</span></a>). | ||
4304 | </li> | ||
4305 | <li>The domainpart of the JID contained in the stanza's 'from' attribute MUST match the FQDN of the sending server (or any validated domain thereof) as communicated via SASL negotiation (see <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>), Server Dialback (see <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>), or similar means; if a server receives a stanza that does not meet this restriction, it MUST close the stream with an <invalid-from/> stream error (<a class='info' href='#streams-error-conditions-invalid-from'>Section 4.9.3.9<span> (</span><span class='info'>invalid-from</span><span>)</span></a>). | ||
4306 | </li> | ||
4307 | </ol><p> | ||
4308 | |||
4309 | </p> | ||
4310 | <p>Enforcement of these rules helps to prevent certain denial-of-service attacks as described under <a class='info' href='#security-dos'>Section 13.12<span> (</span><span class='info'>Denial of Service</span><span>)</span></a>. | ||
4311 | </p> | ||
4312 | <a name="stanzas-attributes-id"></a><br /><hr /> | ||
4313 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4314 | <a name="rfc.section.8.1.3"></a><h3>8.1.3. | ||
4315 | id</h3> | ||
4316 | |||
4317 | <p>The 'id' attribute is used by the originating entity to track any response or error stanza that it might receive in relation to the generated stanza from another entity (such as an intermediate server or the intended recipient). | ||
4318 | </p> | ||
4319 | <p>It is up to the originating entity whether the value of the 'id' attribute is unique only within its current stream or unique globally. | ||
4320 | </p> | ||
4321 | <p>For <message/> and <presence/> stanzas, it is RECOMMENDED for the originating entity to include an 'id' attribute; for <iq/> stanzas, it is REQUIRED. | ||
4322 | </p> | ||
4323 | <p>If the generated stanza includes an 'id' attribute then it is REQUIRED for the response or error stanza to also include an 'id' attribute, where the value of the 'id' attribute MUST match that of the generated stanza. | ||
4324 | </p> | ||
4325 | <p>The semantics of IQ stanzas impose additional restrictions as described under <a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>. | ||
4326 | </p> | ||
4327 | <a name="stanzas-attributes-type"></a><br /><hr /> | ||
4328 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4329 | <a name="rfc.section.8.1.4"></a><h3>8.1.4. | ||
4330 | type</h3> | ||
4331 | |||
4332 | <p>The 'type' attribute specifies the purpose or context of the message, presence, or IQ stanza. The particular allowable values for the 'type' attribute vary depending on whether the stanza is a message, presence, or IQ stanza. The defined values for message and presence stanzas are specific to instant messaging and presence applications and therefore are defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>, whereas the values for IQ stanzas specify the part of the semantics for all structured request-response exchanges (no matter what the payload) and therefore are specified under <a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a>. The only 'type' value common to all three kinds of stanzas is "error" as described under <a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a>. | ||
4333 | </p> | ||
4334 | <a name="stanzas-attributes-lang"></a><br /><hr /> | ||
4335 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4336 | <a name="rfc.section.8.1.5"></a><h3>8.1.5. | ||
4337 | xml:lang</h3> | ||
4338 | |||
4339 | <p>A stanza SHOULD possess an 'xml:lang' attribute (as defined in Section 2.12 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) if the stanza contains XML character data that is intended to be presented to a human user (as explained in <a class='info' href='#CHARSETS'>[CHARSETS]<span> (</span><span class='info'>Alvestrand, H., “IETF Policy on Character Sets and Languages,” January 1998.</span><span>)</span></a>, "internationalization is for humans"). The value of the 'xml:lang' attribute specifies the default language of any such human-readable XML character data. | ||
4340 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4341 | <presence from='romeo@example.net/orchard' xml:lang='en'> | ||
4342 | <show>dnd</show> | ||
4343 | <status>Wooing Juliet</status> | ||
4344 | </presence> | ||
4345 | </pre></div> | ||
4346 | <p>The value of the 'xml:lang' attribute MAY be overridden by the 'xml:lang' attribute of a specific child element. | ||
4347 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4348 | <presence from='romeo@example.net/orchard' xml:lang='en'> | ||
4349 | <show>dnd</show> | ||
4350 | <status>Wooing Juliet</status> | ||
4351 | <status xml:lang='cs'>Dvo&#x0159;&#x00ED;m se Julii</status> | ||
4352 | </presence> | ||
4353 | </pre></div> | ||
4354 | <p>If an outbound stanza generated by a client does not possess an 'xml:lang' attribute, the client's server SHOULD add an 'xml:lang' attribute whose value is that specified for the client's output stream as defined under <a class='info' href='#streams-attr-xmllang'>Section 4.7.4<span> (</span><span class='info'>xml:lang</span><span>)</span></a>. | ||
4355 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4356 | C: <presence from='romeo@example.net/orchard'> | ||
4357 | <show>dnd</show> | ||
4358 | <status>Wooing Juliet</status> | ||
4359 | </presence> | ||
4360 | |||
4361 | S: <presence from='romeo@example.net/orchard' | ||
4362 | to='juliet@im.example.com' | ||
4363 | xml:lang='en'> | ||
4364 | <show>dnd</show> | ||
4365 | <status>Wooing Juliet</status> | ||
4366 | </presence> | ||
4367 | </pre></div> | ||
4368 | <p>If an inbound stanza received by a client or server does not possess an 'xml:lang' attribute, an implementation MUST assume that the default language is that specified for the entity's input stream as defined under <a class='info' href='#streams-attr-xmllang'>Section 4.7.4<span> (</span><span class='info'>xml:lang</span><span>)</span></a>. | ||
4369 | </p> | ||
4370 | <p>The value of the 'xml:lang' attribute MUST conform to the NMTOKEN datatype (as defined in Section 2.3 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) and MUST conform to the format defined in <a class='info' href='#LANGTAGS'>[LANGTAGS]<span> (</span><span class='info'>Phillips, A. and M. Davis, “Tags for Identifying Languages,” September 2009.</span><span>)</span></a>. | ||
4371 | </p> | ||
4372 | <p>A server MUST NOT modify or delete 'xml:lang' attributes on stanzas it receives from other entities. | ||
4373 | </p> | ||
4374 | <a name="stanzas-semantics"></a><br /><hr /> | ||
4375 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4376 | <a name="rfc.section.8.2"></a><h3>8.2. | ||
4377 | Basic Semantics</h3> | ||
4378 | |||
4379 | <a name="stanzas-semantics-message"></a><br /><hr /> | ||
4380 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4381 | <a name="rfc.section.8.2.1"></a><h3>8.2.1. | ||
4382 | Message Semantics</h3> | ||
4383 | |||
4384 | <p>The <message/> stanza is a "push" mechanism whereby one entity pushes information to another entity, similar to the communications that occur in a system such as email. All message stanzas will possess a 'to' attribute that specifies the intended recipient of the message (see <a class='info' href='#stanzas-attributes-to'>Section 8.1.1<span> (</span><span class='info'>to</span><span>)</span></a> and <a class='info' href='#rules-noto'>Section 10.3<span> (</span><span class='info'>No 'to' Address</span><span>)</span></a>), unless the message is being sent to the bare JID of a connected client's account. Upon receiving a message stanza with a 'to' address, a server SHOULD attempt to route or deliver it to the intended recipient (see <a class='info' href='#rules'>Section 10<span> (</span><span class='info'>Server Rules for Processing XML Stanzas</span><span>)</span></a> for general routing and delivery rules related to XML stanzas). | ||
4385 | </p> | ||
4386 | <a name="stanzas-semantics-presence"></a><br /><hr /> | ||
4387 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4388 | <a name="rfc.section.8.2.2"></a><h3>8.2.2. | ||
4389 | Presence Semantics</h3> | ||
4390 | |||
4391 | <p>The <presence/> stanza is a specialized "broadcast" or "publish-subscribe" mechanism, whereby multiple entities receive information (in this case, network availability information) about an entity to which they have subscribed. In general, a publishing client SHOULD send a presence stanza with no 'to' attribute, in which case the server to which the client is connected will broadcast that stanza to all subscribed entities. However, a publishing client MAY also send a presence stanza with a 'to' attribute, in which case the server will route or deliver that stanza to the intended recipient. Although the <presence/> stanza is most often used by XMPP clients, it can also be used by servers, add-on services, and any other kind of XMPP entity. See <a class='info' href='#rules'>Section 10<span> (</span><span class='info'>Server Rules for Processing XML Stanzas</span><span>)</span></a> for general routing and delivery rules related to XML stanzas, and <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a> for rules specific to presence applications. | ||
4392 | </p> | ||
4393 | <a name="stanzas-semantics-iq"></a><br /><hr /> | ||
4394 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4395 | <a name="rfc.section.8.2.3"></a><h3>8.2.3. | ||
4396 | IQ Semantics</h3> | ||
4397 | |||
4398 | <p>Info/Query, or IQ, is a "request-response" mechanism, similar in some ways to the Hypertext Transfer Protocol <a class='info' href='#HTTP'>[HTTP]<span> (</span><span class='info'>Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1,” June 1999.</span><span>)</span></a>. The semantics of IQ enable an entity to make a request of, and receive a response from, another entity. The data content of the request and response is defined by the schema or other structural definition associated with the XML namespace that qualifies the direct child element of the IQ element (see <a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a>), and the interaction is tracked by the requesting entity through use of the 'id' attribute. Thus, IQ interactions follow a common pattern of structured data exchange such as get/result or set/result (although an error can be returned in reply to a request if appropriate): | ||
4399 | </p><br /><hr class="insert" /> | ||
4400 | <a name="figure-5"></a> | ||
4401 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4402 | Requesting Responding | ||
4403 | Entity Entity | ||
4404 | ---------- ---------- | ||
4405 | | | | ||
4406 | | <iq id='1' type='get'> | | ||
4407 | | [ ... payload ... ] | | ||
4408 | | </iq> | | ||
4409 | | -------------------------> | | ||
4410 | | | | ||
4411 | | <iq id='1' type='result'> | | ||
4412 | | [ ... payload ... ] | | ||
4413 | | </iq> | | ||
4414 | | <------------------------- | | ||
4415 | | | | ||
4416 | | <iq id='2' type='set'> | | ||
4417 | | [ ... payload ... ] | | ||
4418 | | </iq> | | ||
4419 | | -------------------------> | | ||
4420 | | | | ||
4421 | | <iq id='2' type='error'> | | ||
4422 | | [ ... condition ... ] | | ||
4423 | | </iq> | | ||
4424 | | <------------------------- | | ||
4425 | | | | ||
4426 | </pre></div><table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b> Figure 5: Semantics of IQ Stanzas </b></font><br /></td></tr></table><hr class="insert" /> | ||
4427 | |||
4428 | <p>To enforce these semantics, the following rules apply: | ||
4429 | </p> | ||
4430 | <p></p> | ||
4431 | <ol class="text"> | ||
4432 | <li>The 'id' attribute is REQUIRED for IQ stanzas. | ||
4433 | </li> | ||
4434 | <li>The 'type' attribute is REQUIRED for IQ stanzas. The value MUST be one of the following; if not, the recipient or an intermediate router MUST return a <bad-request/> stanza error (<a class='info' href='#stanzas-error-conditions-bad-request'>Section 8.3.3.1<span> (</span><span class='info'>bad-request</span><span>)</span></a>). | ||
4435 | |||
4436 | |||
4437 | <ul class="text"> | ||
4438 | <li>get -- The stanza requests information, inquires about what data is needed in order to complete further operations, etc. | ||
4439 | </li> | ||
4440 | <li>set -- The stanza provides data that is needed for an operation to be completed, sets new values, replaces existing values, etc. | ||
4441 | </li> | ||
4442 | <li>result -- The stanza is a response to a successful get or set request. | ||
4443 | </li> | ||
4444 | <li>error -- The stanza reports an error that has occurred regarding processing or delivery of a get or set request (see <a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a>). | ||
4445 | </li> | ||
4446 | </ul> | ||
4447 | |||
4448 | </li> | ||
4449 | <li>An entity that receives an IQ request of type "get" or "set" MUST reply with an IQ response of type "result" or "error". The response MUST preserve the 'id' attribute of the request (or be empty if the generated stanza did not include an 'id' attribute). | ||
4450 | </li> | ||
4451 | <li>An entity that receives a stanza of type "result" or "error" MUST NOT respond to the stanza by sending a further IQ response of type "result" or "error"; however, the requesting entity MAY send another request (e.g., an IQ of type "set" to provide obligatory information discovered through a get/result pair). | ||
4452 | </li> | ||
4453 | <li>An IQ stanza of type "get" or "set" MUST contain exactly one child element, which specifies the semantics of the particular request. | ||
4454 | </li> | ||
4455 | <li>An IQ stanza of type "result" MUST include zero or one child elements. | ||
4456 | </li> | ||
4457 | <li>An IQ stanza of type "error" MAY include the child element contained in the associated "get" or "set" and MUST include an <error/> child; for details, see <a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a>. | ||
4458 | </li> | ||
4459 | </ol> | ||
4460 | |||
4461 | <a name="stanzas-error"></a><br /><hr /> | ||
4462 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4463 | <a name="rfc.section.8.3"></a><h3>8.3. | ||
4464 | Stanza Errors</h3> | ||
4465 | |||
4466 | <p>Stanza-related errors are handled in a manner similar to <a class='info' href='#streams-error'>stream errors<span> (</span><span class='info'>Stream Errors</span><span>)</span></a>. Unlike stream errors, stanza errors are recoverable; therefore, they do not result in termination of the XML stream and underlying TCP connection. Instead, the entity that discovers the error condition returns an error stanza, which is a stanza that: | ||
4467 | </p> | ||
4468 | <p> | ||
4469 | </p> | ||
4470 | <ul class="text"> | ||
4471 | <li>is of the same kind (message, presence, or IQ) as the generated stanza that triggered the error | ||
4472 | </li> | ||
4473 | <li>has a 'type' attribute set to a value of "error" | ||
4474 | </li> | ||
4475 | <li>typically swaps the 'from' and 'to' addresses of the generated stanza | ||
4476 | </li> | ||
4477 | <li>mirrors the 'id' attribute (if any) of the generated stanza that triggered the error | ||
4478 | </li> | ||
4479 | <li>contains an <error/> child element that specifies the error condition and therefore provides a hint regarding actions that the sender might be able to take in an effort to remedy the error (however, it is not always possible to remedy the error) | ||
4480 | </li> | ||
4481 | </ul><p> | ||
4482 | |||
4483 | </p> | ||
4484 | <a name="stanzas-error-rules"></a><br /><hr /> | ||
4485 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4486 | <a name="rfc.section.8.3.1"></a><h3>8.3.1. | ||
4487 | Rules</h3> | ||
4488 | |||
4489 | <p>The following rules apply to stanza errors: | ||
4490 | </p> | ||
4491 | <p></p> | ||
4492 | <ol class="text"> | ||
4493 | <li>The receiving or processing entity that detects an error condition in relation to a stanza SHOULD return an error stanza (and MUST do so for IQ stanzas). | ||
4494 | </li> | ||
4495 | <li>The error stanza SHOULD simply swap the 'from' and 'to' addresses from the generated stanza, unless doing so would (1) result in an information leak (see under <a class='info' href='#security-leaks'>Section 13.10<span> (</span><span class='info'>Information Leaks</span><span>)</span></a>) or other breach of security, or (2) force the sender of the error stanza to include a malformed JID in the 'from' or 'to' address of the error stanza. | ||
4496 | </li> | ||
4497 | <li>If the generated stanza was <message/> or <presence/> and included an 'id' attribute then it is REQUIRED for the error stanza to also include an 'id' attribute. If the generated stanza was <iq/> then the error stanza MUST include an 'id' attribute. In all cases, the value of the 'id' attribute MUST match that of the generated stanza (or be empty if the generated stanza did not include an 'id' attribute). | ||
4498 | </li> | ||
4499 | <li>An error stanza MUST contain an <error/> child element. | ||
4500 | </li> | ||
4501 | <li>The entity that returns an error stanza MAY pass along its JID to the sender of the generated stanza (e.g., for diagnostic or tracking purposes) through the addition of a 'by' attribute to the <error/> child element. | ||
4502 | </li> | ||
4503 | <li>The entity that returns an error stanza MAY include the original XML sent so that the sender can inspect and, if necessary, correct the XML before attempting to resend (however, this is a courtesy only and the originating entity MUST NOT depend on receiving the original payload). Naturally, the entity MUST NOT include the original data if it not well-formed XML, violates the XML restrictions of XMPP (see under <a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a>), or is otherwise harmful (e.g., exceeds a size limit). | ||
4504 | </li> | ||
4505 | <li>An <error/> child MUST NOT be included if the 'type' attribute has a value other than "error" (or if there is no 'type' attribute). | ||
4506 | </li> | ||
4507 | <li>An entity that receives an error stanza MUST NOT respond to the stanza with a further error stanza; this helps to prevent looping. | ||
4508 | </li> | ||
4509 | </ol> | ||
4510 | |||
4511 | <a name="stanzas-error-syntax"></a><br /><hr /> | ||
4512 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4513 | <a name="rfc.section.8.3.2"></a><h3>8.3.2. | ||
4514 | Syntax</h3> | ||
4515 | |||
4516 | <p>The syntax for stanza-related errors is as follows, where XML data shown within the square brackets '[' and ']' is OPTIONAL, 'intended-recipient' is the JID of the entity to which the original stanza was addressed, 'sender' is the JID of the originating entity, and 'error-generator' is the entity that detects the fact that an error has occurred and thus returns an error stanza. | ||
4517 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4518 | <stanza-kind from='intended-recipient' to='sender' type='error'> | ||
4519 | [OPTIONAL to include sender XML here] | ||
4520 | <error [by='error-generator'] | ||
4521 | type='error-type'> | ||
4522 | <defined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4523 | [<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' | ||
4524 | xml:lang='langcode'> | ||
4525 | OPTIONAL descriptive text | ||
4526 | </text>] | ||
4527 | [OPTIONAL application-specific condition element] | ||
4528 | </error> | ||
4529 | </stanza-kind> | ||
4530 | </pre></div> | ||
4531 | <p>The "stanza-kind" MUST be one of message, presence, or iq. | ||
4532 | </p> | ||
4533 | <p>The "error-type" MUST be one of the following: | ||
4534 | </p> | ||
4535 | <p> | ||
4536 | </p> | ||
4537 | <ul class="text"> | ||
4538 | <li>auth -- retry after providing credentials | ||
4539 | </li> | ||
4540 | <li>cancel -- do not retry (the error cannot be remedied) | ||
4541 | </li> | ||
4542 | <li>continue -- proceed (the condition was only a warning) | ||
4543 | </li> | ||
4544 | <li>modify -- retry after changing the data sent | ||
4545 | </li> | ||
4546 | <li>wait -- retry after waiting (the error is temporary) | ||
4547 | </li> | ||
4548 | </ul><p> | ||
4549 | |||
4550 | </p> | ||
4551 | <p>The "defined-condition" MUST correspond to one of the stanza error conditions defined under <a class='info' href='#stanzas-error-conditions'>Section 8.3.3<span> (</span><span class='info'>Defined Conditions</span><span>)</span></a>. However, because additional error conditions might be defined in the future, if an entity receives a stanza error condition that it does not understand then it MUST treat the unknown condition as equivalent to <undefined-condition/> (<a class='info' href='#stanzas-error-conditions-undefined-condition'>Section 8.3.3.21<span> (</span><span class='info'>undefined-condition</span><span>)</span></a>). If the designers of an XMPP protocol extension or the developers of an XMPP implementation need to communicate a stanza error condition that is not defined in this specification, they can do so by defining an application-specific error condition element qualified by an application-specific namespace. | ||
4552 | </p> | ||
4553 | <p>The <error/> element: | ||
4554 | </p> | ||
4555 | <p></p> | ||
4556 | <ul class="text"> | ||
4557 | <li>MUST contain a defined condition element. | ||
4558 | </li> | ||
4559 | <li>MAY contain a <text/> child element containing XML character data that describes the error in more detail; this element MUST be qualified by the 'urn:ietf:params:xml:ns:xmpp-stanzas' namespace and SHOULD possess an 'xml:lang' attribute specifying the natural language of the XML character data. | ||
4560 | </li> | ||
4561 | <li>MAY contain a child element for an application-specific error condition; this element MUST be qualified by an application-specific namespace that defines the syntax and semantics of the element. | ||
4562 | </li> | ||
4563 | </ul> | ||
4564 | |||
4565 | <p>The <text/> element is OPTIONAL. If included, it is to be used only to provide descriptive or diagnostic information that supplements the meaning of a defined condition or application-specific condition. It MUST NOT be interpreted programmatically by an application. It SHOULD NOT be used as the error message presented to a human user, but MAY be shown in addition to the error message associated with the defined condition element (and, optionally, the application-specific condition element). | ||
4566 | </p> | ||
4567 | <p></p> | ||
4568 | <blockquote class="text"> | ||
4569 | <p>Interoperability Note: The syntax defined in <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a> included a legacy 'code' attribute, whose semantics have been replaced by the defined condition elements; information about mapping defined condition elements to values of the legacy 'code' attribute can be found in <a class='info' href='#XEP-0086'>[XEP‑0086]<span> (</span><span class='info'>Norris, R. and P. Saint-Andre, “Error Condition Mappings,” February 2004.</span><span>)</span></a>. | ||
4570 | </p> | ||
4571 | </blockquote> | ||
4572 | |||
4573 | <a name="stanzas-error-conditions"></a><br /><hr /> | ||
4574 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4575 | <a name="rfc.section.8.3.3"></a><h3>8.3.3. | ||
4576 | Defined Conditions</h3> | ||
4577 | |||
4578 | <p>The following conditions are defined for use in stanza errors. | ||
4579 | </p> | ||
4580 | <p>The error-type value that is RECOMMENDED for each defined condition is the usual expected type; however, in some circumstances a different type might be more appropriate. | ||
4581 | </p> | ||
4582 | <a name="stanzas-error-conditions-bad-request"></a><br /><hr /> | ||
4583 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4584 | <a name="rfc.section.8.3.3.1"></a><h3>8.3.3.1. | ||
4585 | bad-request</h3> | ||
4586 | |||
4587 | <p>The sender has sent a stanza containing XML that does not conform to the appropriate schema or that cannot be processed (e.g., an IQ stanza that includes an unrecognized value of the 'type' attribute, or an element that is qualified by a recognized namespace but that violates the defined syntax for the element); the associated error type SHOULD be "modify". | ||
4588 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4589 | C: <iq from='juliet@im.example.com/balcony' | ||
4590 | id='zj3v142b' | ||
4591 | to='im.example.com' | ||
4592 | type='subscribe'> | ||
4593 | <ping xmlns='urn:xmpp:ping'/> | ||
4594 | </iq> | ||
4595 | |||
4596 | S: <iq from='im.example.com' | ||
4597 | id='zj3v142b' | ||
4598 | to='juliet@im.example.com/balcony' | ||
4599 | type='error'> | ||
4600 | <error type='modify'> | ||
4601 | <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4602 | </error> | ||
4603 | </iq> | ||
4604 | </pre></div> | ||
4605 | <a name="stanzas-error-conditions-conflict"></a><br /><hr /> | ||
4606 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4607 | <a name="rfc.section.8.3.3.2"></a><h3>8.3.3.2. | ||
4608 | conflict</h3> | ||
4609 | |||
4610 | <p>Access cannot be granted because an existing resource exists with the same name or address; the associated error type SHOULD be "cancel". | ||
4611 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4612 | C: <iq id='wy2xa82b4' type='set'> | ||
4613 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
4614 | <resource>balcony</resource> | ||
4615 | </bind> | ||
4616 | </iq> | ||
4617 | |||
4618 | S: <iq id='wy2xa82b4' type='error'> | ||
4619 | <error type='cancel'> | ||
4620 | <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4621 | </error> | ||
4622 | </iq> | ||
4623 | </pre></div> | ||
4624 | <a name="stanzas-error-conditions-feature-not-implemented"></a><br /><hr /> | ||
4625 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4626 | <a name="rfc.section.8.3.3.3"></a><h3>8.3.3.3. | ||
4627 | feature-not-implemented</h3> | ||
4628 | |||
4629 | <p>The feature represented in the XML stanza is not implemented by the intended recipient or an intermediate server and therefore the stanza cannot be processed (e.g., the entity understands the namespace but does not recognize the element name); the associated error type SHOULD be "cancel" or "modify". | ||
4630 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4631 | C: <iq from='juliet@im.example.com/balcony' | ||
4632 | id='9u2bax16' | ||
4633 | to='pubsub.example.com' | ||
4634 | type='get'> | ||
4635 | <pubsub xmlns='http://jabber.org/protocol/pubsub'> | ||
4636 | <subscriptions/> | ||
4637 | </pubsub> | ||
4638 | </iq> | ||
4639 | |||
4640 | E: <iq from='pubsub.example.com' | ||
4641 | id='9u2bax16' | ||
4642 | to='juliet@im.example.com/balcony' | ||
4643 | type='error'> | ||
4644 | <error type='cancel'> | ||
4645 | <feature-not-implemented | ||
4646 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4647 | <unsupported | ||
4648 | xmlns='http://jabber.org/protocol/pubsub#errors' | ||
4649 | feature='retrieve-subscriptions'/> | ||
4650 | </error> | ||
4651 | </iq> | ||
4652 | </pre></div> | ||
4653 | <a name="stanzas-error-conditions-forbidden"></a><br /><hr /> | ||
4654 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4655 | <a name="rfc.section.8.3.3.4"></a><h3>8.3.3.4. | ||
4656 | forbidden</h3> | ||
4657 | |||
4658 | <p>The requesting entity does not possess the necessary permissions to perform an action that only certain authorized roles or individuals are allowed to complete (i.e., it typically relates to authorization rather than authentication); the associated error type SHOULD be "auth". | ||
4659 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4660 | C: <presence | ||
4661 | from='juliet@im.example.com/balcony' | ||
4662 | id='y2bs71v4' | ||
4663 | to='characters@muc.example.com/JulieC'> | ||
4664 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4665 | </presence> | ||
4666 | |||
4667 | E: <presence | ||
4668 | from='characters@muc.example.com/JulieC' | ||
4669 | id='y2bs71v4' | ||
4670 | to='juliet@im.example.com/balcony' | ||
4671 | type='error'> | ||
4672 | <error type='auth'> | ||
4673 | <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4674 | </error> | ||
4675 | </presence> | ||
4676 | </pre></div> | ||
4677 | <a name="stanzas-error-conditions-gone"></a><br /><hr /> | ||
4678 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4679 | <a name="rfc.section.8.3.3.5"></a><h3>8.3.3.5. | ||
4680 | gone</h3> | ||
4681 | |||
4682 | <p>The recipient or server can no longer be contacted at this address, typically on a permanent basis (as opposed to the <redirect/> error condition, which is used for temporary addressing failures); the associated error type SHOULD be "cancel" and the error stanza SHOULD include a new address (if available) as the XML character data of the <gone/> element (which MUST be a Uniform Resource Identifier <a class='info' href='#URI'>[URI]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a> or Internationalized Resource Identifier <a class='info' href='#IRI'>[IRI]<span> (</span><span class='info'>Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.</span><span>)</span></a> at which the entity can be contacted, typically an XMPP IRI as specified in <a class='info' href='#XMPP-URI'>[XMPP‑URI]<span> (</span><span class='info'>Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.</span><span>)</span></a>). | ||
4683 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4684 | C: <message | ||
4685 | from='juliet@im.example.com/churchyard' | ||
4686 | id='sj2b371v' | ||
4687 | to='romeo@example.net' | ||
4688 | type='chat'> | ||
4689 | <body>Thy lips are warm.</body> | ||
4690 | </message> | ||
4691 | |||
4692 | S: <message | ||
4693 | from='romeo@example.net' | ||
4694 | id='sj2b371v' | ||
4695 | to='juliet@im.example.com/churchyard' | ||
4696 | type='error'> | ||
4697 | <error by='example.net' | ||
4698 | type='cancel'> | ||
4699 | <gone xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'> | ||
4700 | xmpp:romeo@afterlife.example.net | ||
4701 | </gone> | ||
4702 | </error> | ||
4703 | </message> | ||
4704 | </pre></div> | ||
4705 | <a name="stanzas-error-conditions-internal-server-error"></a><br /><hr /> | ||
4706 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4707 | <a name="rfc.section.8.3.3.6"></a><h3>8.3.3.6. | ||
4708 | internal-server-error</h3> | ||
4709 | |||
4710 | <p>The server has experienced a misconfiguration or other | ||
4711 | internal error that prevents it from processing the stanza; | ||
4712 | the associated error type SHOULD be "cancel". | ||
4713 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4714 | C: <presence | ||
4715 | from='juliet@im.example.com/balcony' | ||
4716 | id='y2bs71v4' | ||
4717 | to='characters@muc.example.com/JulieC'> | ||
4718 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4719 | </presence> | ||
4720 | |||
4721 | E: <presence | ||
4722 | from='characters@muc.example.com/JulieC' | ||
4723 | id='y2bs71v4' | ||
4724 | to='juliet@im.example.com/balcony' | ||
4725 | type='error'> | ||
4726 | <error type='cancel'> | ||
4727 | <internal-server-error | ||
4728 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4729 | </error> | ||
4730 | </presence> | ||
4731 | </pre></div> | ||
4732 | <a name="stanzas-error-conditions-item-not-found"></a><br /><hr /> | ||
4733 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4734 | <a name="rfc.section.8.3.3.7"></a><h3>8.3.3.7. | ||
4735 | item-not-found</h3> | ||
4736 | |||
4737 | <p>The addressed JID or item requested cannot be found; the associated error type SHOULD be "cancel". | ||
4738 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4739 | C: <presence from='userfoo@example.com/bar' | ||
4740 | id='pwb2n78i' | ||
4741 | to='nosuchroom@conference.example.org/foo'/> | ||
4742 | |||
4743 | S: <presence from='nosuchroom@conference.example.org/foo' | ||
4744 | id='pwb2n78i' | ||
4745 | to='userfoo@example.com/bar' | ||
4746 | type='error'> | ||
4747 | <error type='cancel'> | ||
4748 | <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4749 | </error> | ||
4750 | </presence> | ||
4751 | </pre></div> | ||
4752 | <p></p> | ||
4753 | <blockquote class="text"> | ||
4754 | <p>Security Warning: An application MUST NOT return this error if doing so would provide information about the intended recipient's network availability to an entity that is not authorized to know such information (for a more detailed discussion of presence authorization, refer to the discussion of presence subscriptions in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>); instead it MUST return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>). | ||
4755 | </p> | ||
4756 | </blockquote> | ||
4757 | |||
4758 | <a name="stanzas-error-conditions-jid-malformed"></a><br /><hr /> | ||
4759 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4760 | <a name="rfc.section.8.3.3.8"></a><h3>8.3.3.8. | ||
4761 | jid-malformed</h3> | ||
4762 | |||
4763 | <p>The sending entity has provided (e.g., during resource binding) or communicated (e.g., in the 'to' address of a stanza) an XMPP address or aspect thereof that violates the rules defined in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>; the associated error type SHOULD be "modify". | ||
4764 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4765 | C: <presence | ||
4766 | from='juliet@im.example.com/balcony' | ||
4767 | id='y2bs71v4' | ||
4768 | to='ch@r@cters@muc.example.com/JulieC'> | ||
4769 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4770 | </presence> | ||
4771 | |||
4772 | E: <presence | ||
4773 | from='ch@r@cters@muc.example.com/JulieC' | ||
4774 | id='y2bs71v4' | ||
4775 | to='juliet@im.example.com/balcony' | ||
4776 | type='error'> | ||
4777 | <error by='muc.example.com' | ||
4778 | type='modify'> | ||
4779 | <jid-malformed | ||
4780 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4781 | </error> | ||
4782 | </presence> | ||
4783 | </pre></div> | ||
4784 | <p></p> | ||
4785 | <blockquote class="text"> | ||
4786 | <p>Implementation Note: Enforcement of the format for XMPP localparts is primarily the responsibility of the service at which the associated account or entity is located (e.g., the example.com service is responsible for returning <jid-malformed/> errors related to all JIDs of the form <localpart@example.com>), whereas enforcement of the format for XMPP domainparts is primarily the responsibility of the service that seeks to route a stanza to the service identified by that domainpart (e.g., the example.org service is responsible for returning <jid-malformed/> errors related to stanzas that users of that service have to tried send to JIDs of the form <localpart@example.com>). However, any entity that detects a malformed JID MAY return this error. | ||
4787 | </p> | ||
4788 | </blockquote> | ||
4789 | |||
4790 | <a name="stanzas-error-conditions-not-acceptable"></a><br /><hr /> | ||
4791 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4792 | <a name="rfc.section.8.3.3.9"></a><h3>8.3.3.9. | ||
4793 | not-acceptable</h3> | ||
4794 | |||
4795 | <p>The recipient or server understands the request but cannot process it because the request does not meet criteria defined by the recipient or server (e.g., a request to subscribe to information that does not simultaneously include configuration parameters needed by the recipient); the associated error type SHOULD be "modify". | ||
4796 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4797 | C: <message to='juliet@im.example.com' id='yt2vs71m'> | ||
4798 | <body>[ ... the-emacs-manual ... ]</body> | ||
4799 | </message> | ||
4800 | |||
4801 | S: <message from='juliet@im.example.com' id='yt2vs71m'> | ||
4802 | <error type='modify'> | ||
4803 | <not-acceptable | ||
4804 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4805 | </error> | ||
4806 | </message> | ||
4807 | </pre></div> | ||
4808 | <a name="stanzas-error-conditions-not-allowed"></a><br /><hr /> | ||
4809 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4810 | <a name="rfc.section.8.3.3.10"></a><h3>8.3.3.10. | ||
4811 | not-allowed</h3> | ||
4812 | |||
4813 | <p>The recipient or server does not allow any entity to perform the action (e.g., sending to entities at a blacklisted domain); the associated error type SHOULD be "cancel". | ||
4814 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4815 | C: <presence | ||
4816 | from='juliet@im.example.com/balcony' | ||
4817 | id='y2bs71v4' | ||
4818 | to='characters@muc.example.com/JulieC'> | ||
4819 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4820 | </presence> | ||
4821 | |||
4822 | E: <presence | ||
4823 | from='characters@muc.example.com/JulieC' | ||
4824 | id='y2bs71v4' | ||
4825 | to='juliet@im.example.com/balcony' | ||
4826 | type='error'> | ||
4827 | <error type='cancel'> | ||
4828 | <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4829 | </error> | ||
4830 | </presence> | ||
4831 | </pre></div> | ||
4832 | <a name="stanzas-error-conditions-not-authorized"></a><br /><hr /> | ||
4833 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4834 | <a name="rfc.section.8.3.3.11"></a><h3>8.3.3.11. | ||
4835 | not-authorized</h3> | ||
4836 | |||
4837 | <p>The sender needs to provide credentials before being allowed to perform the action, or has provided improper credentials (the name "not-authorized", which was borrowed from the "401 Unauthorized" error of <a class='info' href='#HTTP'>[HTTP]<span> (</span><span class='info'>Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1,” June 1999.</span><span>)</span></a>, might lead the reader to think that this condition relates to authorization, but instead it is typically used in relation to authentication); the associated error type SHOULD be "auth". | ||
4838 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4839 | C: <presence | ||
4840 | from='juliet@im.example.com/balcony' | ||
4841 | id='y2bs71v4' | ||
4842 | to='characters@muc.example.com/JulieC'> | ||
4843 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4844 | </presence> | ||
4845 | |||
4846 | E: <presence | ||
4847 | from='characters@muc.example.com/JulieC' | ||
4848 | id='y2bs71v4' | ||
4849 | to='juliet@im.example.com/balcony'> | ||
4850 | <error type='auth'> | ||
4851 | <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4852 | </error> | ||
4853 | </presence> | ||
4854 | </pre></div> | ||
4855 | <a name="stanzas-error-conditions-policy-violation"></a><br /><hr /> | ||
4856 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4857 | <a name="rfc.section.8.3.3.12"></a><h3>8.3.3.12. | ||
4858 | policy-violation</h3> | ||
4859 | |||
4860 | <p>The entity has violated some local service policy (e.g., a message contains words that are prohibited by the service) and the server MAY choose to specify the policy in the <text/> element or in an application-specific condition element; the associated error type SHOULD be "modify" or "wait" depending on the policy being violated. | ||
4861 | </p> | ||
4862 | <p>(In the following example, the client sends an XMPP message containing words that are forbidden according to the server's local service policy.) | ||
4863 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4864 | C: <message from='romeo@example.net/foo' | ||
4865 | to='bill@im.example.com' | ||
4866 | id='vq71f4nb'> | ||
4867 | <body>%#&@^!!!</body> | ||
4868 | </message> | ||
4869 | |||
4870 | S: <message from='bill@im.example.com' | ||
4871 | id='vq71f4nb' | ||
4872 | to='romeo@example.net/foo'> | ||
4873 | <error by='example.net' type='modify'> | ||
4874 | <policy-violation | ||
4875 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4876 | </error> | ||
4877 | </message> | ||
4878 | </pre></div> | ||
4879 | <a name="stanzas-error-conditions-recipient-unavailable"></a><br /><hr /> | ||
4880 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4881 | <a name="rfc.section.8.3.3.13"></a><h3>8.3.3.13. | ||
4882 | recipient-unavailable</h3> | ||
4883 | |||
4884 | <p>The intended recipient is temporarily unavailable, undergoing maintenance, etc.; the associated error type SHOULD be "wait". | ||
4885 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4886 | C: <presence | ||
4887 | from='juliet@im.example.com/balcony' | ||
4888 | id='y2bs71v4' | ||
4889 | to='characters@muc.example.com/JulieC'> | ||
4890 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4891 | </presence> | ||
4892 | |||
4893 | E: <presence | ||
4894 | from='characters@muc.example.com/JulieC' | ||
4895 | id='y2bs71v4' | ||
4896 | to='juliet@im.example.com/balcony'> | ||
4897 | <error type='wait'> | ||
4898 | <recipient-unavailable | ||
4899 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4900 | </error> | ||
4901 | </presence> | ||
4902 | </pre></div> | ||
4903 | <p></p> | ||
4904 | <blockquote class="text"> | ||
4905 | <p>Security Warning: An application MUST NOT return this error if doing so would provide information about the intended recipient's network availability to an entity that is not authorized to know such information (for a more detailed discussion of presence authorization, refer to the discussion of presence subscriptions in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>); instead it MUST return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>). | ||
4906 | </p> | ||
4907 | </blockquote> | ||
4908 | |||
4909 | <a name="stanzas-error-conditions-redirect"></a><br /><hr /> | ||
4910 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4911 | <a name="rfc.section.8.3.3.14"></a><h3>8.3.3.14. | ||
4912 | redirect</h3> | ||
4913 | |||
4914 | <p>The recipient or server is redirecting requests for this information to another entity, typically in a temporary fashion (as opposed to the <gone/> error condition, which is used for permanent addressing failures); the associated error type SHOULD be "modify" and the error stanza SHOULD contain the alternate address in the XML character data of the <redirect/> element (which MUST be a URI or IRI with which the sender can communicate, typically an XMPP IRI as specified in <a class='info' href='#XMPP-URI'>[XMPP‑URI]<span> (</span><span class='info'>Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.</span><span>)</span></a>). | ||
4915 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4916 | C: <presence | ||
4917 | from='juliet@im.example.com/balcony' | ||
4918 | id='y2bs71v4' | ||
4919 | to='characters@muc.example.com/JulieC'> | ||
4920 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4921 | </presence> | ||
4922 | |||
4923 | E: <presence | ||
4924 | from='characters@muc.example.com/JulieC' | ||
4925 | id='y2bs71v4' | ||
4926 | to='juliet@im.example.com/balcony' | ||
4927 | type='error'> | ||
4928 | <error type='modify'> | ||
4929 | <redirect xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'> | ||
4930 | xmpp:characters@conference.example.org | ||
4931 | </redirect> | ||
4932 | </error> | ||
4933 | </presence> | ||
4934 | </pre></div> | ||
4935 | <p></p> | ||
4936 | <blockquote class="text"> | ||
4937 | <p>Security Warning: An application receiving a stanza-level redirect SHOULD warn a human user of the redirection attempt and request approval before proceeding to communicate with the entity whose address is contained in the XML character data of the <redirect/> element, because that entity might have a different identity or might enforce different security policies. The end-to-end authentication or signing of XMPP stanzas could help to mitigate this risk, since it would enable the sender to determine if the entity to which it has been redirected has the same identity as the entity it originally attempted to contact. An application MAY have a policy of following redirects only if it has authenticated the receiving entity. In addition, an application SHOULD abort the communication attempt after a certain number of successive redirects (e.g., at least 2 but no more than 5). | ||
4938 | </p> | ||
4939 | </blockquote> | ||
4940 | |||
4941 | <a name="stanzas-error-conditions-registration-required"></a><br /><hr /> | ||
4942 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4943 | <a name="rfc.section.8.3.3.15"></a><h3>8.3.3.15. | ||
4944 | registration-required</h3> | ||
4945 | |||
4946 | <p>The requesting entity is not authorized to access the requested service because prior registration is necessary (examples of prior registration include members-only rooms in XMPP multi-user chat <a class='info' href='#XEP-0045'>[XEP‑0045]<span> (</span><span class='info'>Saint-Andre, P., “Multi-User Chat,” July 2007.</span><span>)</span></a> and gateways to non-XMPP instant messaging services, which traditionally required registration in order to use the gateway <a class='info' href='#XEP-0100'>[XEP‑0100]<span> (</span><span class='info'>Saint-Andre, P. and D. Smith, “Gateway Interaction,” October 2005.</span><span>)</span></a>); the associated error type SHOULD be "auth". | ||
4947 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4948 | C: <presence | ||
4949 | from='juliet@im.example.com/balcony' | ||
4950 | id='y2bs71v4' | ||
4951 | to='characters@muc.example.com/JulieC'> | ||
4952 | <x xmlns='http://jabber.org/protocol/muc'/> | ||
4953 | </presence> | ||
4954 | |||
4955 | E: <presence | ||
4956 | from='characters@muc.example.com/JulieC' | ||
4957 | id='y2bs71v4' | ||
4958 | to='juliet@im.example.com/balcony'> | ||
4959 | <error type='auth'> | ||
4960 | <registration-required | ||
4961 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4962 | </error> | ||
4963 | </presence> | ||
4964 | </pre></div> | ||
4965 | <a name="stanzas-error-conditions-remote-server-not-found"></a><br /><hr /> | ||
4966 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4967 | <a name="rfc.section.8.3.3.16"></a><h3>8.3.3.16. | ||
4968 | remote-server-not-found</h3> | ||
4969 | |||
4970 | <p>A remote server or service specified as part or all of the JID of the intended recipient does not exist or cannot be resolved (e.g., there is no _xmpp-server._tcp DNS SRV record, the A or AAAA fallback resolution fails, or A/AAAA lookups succeed but there is no response on the IANA-registered port 5269); the associated error type SHOULD be "cancel". | ||
4971 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4972 | C: <message | ||
4973 | from='romeo@example.net/home' | ||
4974 | id='ud7n1f4h' | ||
4975 | to='bar@example.org' | ||
4976 | type='chat'> | ||
4977 | <body>yt?</body> | ||
4978 | </message> | ||
4979 | |||
4980 | E: <message | ||
4981 | from='bar@example.org' | ||
4982 | id='ud7n1f4h' | ||
4983 | to='romeo@example.net/home' | ||
4984 | type='error'> | ||
4985 | <error type='cancel'> | ||
4986 | <remote-server-not-found | ||
4987 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
4988 | </error> | ||
4989 | </message> | ||
4990 | </pre></div> | ||
4991 | <a name="stanzas-error-conditions-remote-server-timeout"></a><br /><hr /> | ||
4992 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
4993 | <a name="rfc.section.8.3.3.17"></a><h3>8.3.3.17. | ||
4994 | remote-server-timeout</h3> | ||
4995 | |||
4996 | <p>A remote server or service specified as part or all of the JID of the intended recipient (or needed to fulfill a request) was resolved but communications could not be established within a reasonable amount of time (e.g., an XML stream cannot be established at the resolved IP address and port, or an XML stream can be established but stream negotiation fails because of problems with TLS, SASL, Server Dialback, etc.); the associated error type SHOULD be "wait" (unless the error is of a more permanent nature, e.g., the remote server is found but it cannot be authenticated or it violates security policies). | ||
4997 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
4998 | C: <message | ||
4999 | from='romeo@example.net/home' | ||
5000 | id='ud7n1f4h' | ||
5001 | to='bar@example.org' | ||
5002 | type='chat'> | ||
5003 | <body>yt?</body> | ||
5004 | </message> | ||
5005 | |||
5006 | E: <message | ||
5007 | from='bar@example.org' | ||
5008 | id='ud7n1f4h' | ||
5009 | to='romeo@example.net/home' | ||
5010 | type='error'> | ||
5011 | <error type='wait'> | ||
5012 | <remote-server-timeout | ||
5013 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5014 | </error> | ||
5015 | </message> | ||
5016 | </pre></div> | ||
5017 | <a name="stanzas-error-conditions-resource-constraint"></a><br /><hr /> | ||
5018 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5019 | <a name="rfc.section.8.3.3.18"></a><h3>8.3.3.18. | ||
5020 | resource-constraint</h3> | ||
5021 | |||
5022 | <p>The server or recipient is busy or lacks the system resources necessary to service the request; the associated error type SHOULD be "wait". | ||
5023 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5024 | C: <iq from='romeo@example.net/foo' | ||
5025 | id='kj4vz31m' | ||
5026 | to='pubsub.example.com' | ||
5027 | type='get'> | ||
5028 | <pubsub xmlns='http://jabber.org/protocol/pubsub'> | ||
5029 | <items node='my_musings'/> | ||
5030 | </pubsub> | ||
5031 | </iq> | ||
5032 | |||
5033 | E: <iq from='pubsub.example.com' | ||
5034 | id='kj4vz31m' | ||
5035 | to='romeo@example.net/foo' | ||
5036 | type='error'> | ||
5037 | <error type='wait'> | ||
5038 | <resource-constraint | ||
5039 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5040 | </error> | ||
5041 | </iq> | ||
5042 | </pre></div> | ||
5043 | <a name="stanzas-error-conditions-service-unavailable"></a><br /><hr /> | ||
5044 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5045 | <a name="rfc.section.8.3.3.19"></a><h3>8.3.3.19. | ||
5046 | service-unavailable</h3> | ||
5047 | |||
5048 | <p>The server or recipient does not currently provide the requested service; the associated error type SHOULD be "cancel". | ||
5049 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5050 | C: <message from='romeo@example.net/foo' | ||
5051 | to='juliet@im.example.com'> | ||
5052 | <body>Hello?</body> | ||
5053 | </message> | ||
5054 | |||
5055 | S: <message from='juliet@im.example.com/foo' | ||
5056 | to='romeo@example.net'> | ||
5057 | <error type='cancel'> | ||
5058 | <service-unavailable | ||
5059 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5060 | </error> | ||
5061 | </message> | ||
5062 | </pre></div> | ||
5063 | <p></p> | ||
5064 | <blockquote class="text"> | ||
5065 | <p>Security Warning: An application MUST return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>) instead of <item-not-found/> (<a class='info' href='#stanzas-error-conditions-item-not-found'>Section 8.3.3.7<span> (</span><span class='info'>item-not-found</span><span>)</span></a>) or <recipient-unavailable/> (<a class='info' href='#stanzas-error-conditions-recipient-unavailable'>Section 8.3.3.13<span> (</span><span class='info'>recipient-unavailable</span><span>)</span></a>) if sending one of the latter errors would provide information about the intended recipient's network availability to an entity that is not authorized to know such information (for a more detailed discussion of presence authorization, refer to <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
5066 | </p> | ||
5067 | </blockquote> | ||
5068 | |||
5069 | <a name="stanzas-error-conditions-subscription-required"></a><br /><hr /> | ||
5070 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5071 | <a name="rfc.section.8.3.3.20"></a><h3>8.3.3.20. | ||
5072 | subscription-required</h3> | ||
5073 | |||
5074 | <p>The requesting entity is not authorized to access the requested service because a prior subscription is necessary (examples of prior subscription include authorization to receive presence information as defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a> and opt-in data feeds for XMPP publish-subscribe as defined in <a class='info' href='#XEP-0060'>[XEP‑0060]<span> (</span><span class='info'>Millard, P., Saint-Andre, P., and R. Meijer, “Publish-Subscribe,” July 2010.</span><span>)</span></a>); the associated error type SHOULD be "auth". | ||
5075 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5076 | C: <message | ||
5077 | from='romeo@example.net/orchard' | ||
5078 | id='pa73b4n7' | ||
5079 | to='playwright@shakespeare.example.com' | ||
5080 | type='chat'> | ||
5081 | <subject>ACT II, SCENE II</subject> | ||
5082 | <body>help, I forgot my lines!</body> | ||
5083 | </message> | ||
5084 | |||
5085 | E: <message | ||
5086 | from='playwright@shakespeare.example.com' | ||
5087 | id='pa73b4n7' | ||
5088 | to='romeo@example.net/orchard' | ||
5089 | type='error'> | ||
5090 | <error type='auth'> | ||
5091 | <subscription-required | ||
5092 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5093 | </error> | ||
5094 | </message> | ||
5095 | </pre></div> | ||
5096 | <a name="stanzas-error-conditions-undefined-condition"></a><br /><hr /> | ||
5097 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5098 | <a name="rfc.section.8.3.3.21"></a><h3>8.3.3.21. | ||
5099 | undefined-condition</h3> | ||
5100 | |||
5101 | <p>The error condition is not one of those defined by the | ||
5102 | other conditions in this list; any error type can be | ||
5103 | associated with this condition, and it SHOULD NOT be used except in conjunction with an application-specific condition. | ||
5104 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5105 | C: <message | ||
5106 | from='northumberland@shakespeare.example' | ||
5107 | id='richard2-4.1.247' | ||
5108 | to='kingrichard@royalty.england.example'> | ||
5109 | <body>My lord, dispatch; read o'er these articles.</body> | ||
5110 | <amp xmlns='http://jabber.org/protocol/amp'> | ||
5111 | <rule action='notify' | ||
5112 | condition='deliver' | ||
5113 | value='stored'/> | ||
5114 | </amp> | ||
5115 | </message> | ||
5116 | |||
5117 | S: <message from='example.org' | ||
5118 | id='amp1' | ||
5119 | to='northumberland@example.net/field' | ||
5120 | type='error'> | ||
5121 | <amp xmlns='http://jabber.org/protocol/amp' | ||
5122 | from='kingrichard@example.org' | ||
5123 | status='error' | ||
5124 | to='northumberland@example.net/field'> | ||
5125 | <rule action='error' | ||
5126 | condition='deliver' | ||
5127 | value='stored'/> | ||
5128 | </amp> | ||
5129 | <error type='modify'> | ||
5130 | <undefined-condition | ||
5131 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5132 | <failed-rules xmlns='http://jabber.org/protocol/amp#errors'> | ||
5133 | <rule action='error' | ||
5134 | condition='deliver' | ||
5135 | value='stored'/> | ||
5136 | </failed-rules> | ||
5137 | </error> | ||
5138 | </message> | ||
5139 | </pre></div> | ||
5140 | <a name="stanzas-error-conditions-unexpected-request"></a><br /><hr /> | ||
5141 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5142 | <a name="rfc.section.8.3.3.22"></a><h3>8.3.3.22. | ||
5143 | unexpected-request</h3> | ||
5144 | |||
5145 | <p>The recipient or server understood the request but was not expecting it at this time (e.g., the request was out of order); the associated error type SHOULD be "wait" or "modify". | ||
5146 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5147 | C: <iq from='romeo@example.net/foo' | ||
5148 | id='o6hsv25z' | ||
5149 | to='pubsub.example.com' | ||
5150 | type='set'> | ||
5151 | <pubsub xmlns='http://jabber.org/protocol/pubsub'> | ||
5152 | <unsubscribe | ||
5153 | node='my_musings' | ||
5154 | jid='romeo@example.net'/> | ||
5155 | </pubsub> | ||
5156 | </iq> | ||
5157 | |||
5158 | E: <iq from='pubsub.example.com' | ||
5159 | id='o6hsv25z' | ||
5160 | to='romeo@example.net/foo' | ||
5161 | type='error'> | ||
5162 | <error type='modify'> | ||
5163 | <unexpected-request | ||
5164 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5165 | <not-subscribed | ||
5166 | xmlns='http://jabber.org/protocol/pubsub#errors'/> | ||
5167 | </error> | ||
5168 | </iq> | ||
5169 | </pre></div> | ||
5170 | <a name="stanzas-error-app"></a><br /><hr /> | ||
5171 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5172 | <a name="rfc.section.8.3.4"></a><h3>8.3.4. | ||
5173 | Application-Specific Conditions</h3> | ||
5174 | |||
5175 | <p>As noted, an application MAY provide application-specific stanza error information by including a properly namespaced child within the error element. Typically, the application-specific element supplements or further qualifies a defined element. Thus, the <error/> element will contain two or three child elements. | ||
5176 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5177 | <iq id='ixc3v1b9' type='error'> | ||
5178 | <error type='modify'> | ||
5179 | <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5180 | <too-many-parameters xmlns='http://example.org/ns'/> | ||
5181 | </error> | ||
5182 | </iq> | ||
5183 | </pre></div><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5184 | <message type='error' id='7h3baci9'> | ||
5185 | <error type='modify'> | ||
5186 | <undefined-condition | ||
5187 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5188 | <text xml:lang='en' | ||
5189 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'> | ||
5190 | [ ... application-specific information ... ] | ||
5191 | </text> | ||
5192 | <too-many-parameters xmlns='http://example.org/ns'/> | ||
5193 | </error> | ||
5194 | </message> | ||
5195 | </pre></div> | ||
5196 | <p>An entity that receives an application-specific error condition it does not understand MUST ignore that condition but appropriately process the rest of the error stanza. | ||
5197 | </p> | ||
5198 | <a name="stanzas-extended"></a><br /><hr /> | ||
5199 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5200 | <a name="rfc.section.8.4"></a><h3>8.4. | ||
5201 | Extended Content</h3> | ||
5202 | |||
5203 | <p>Although the message, presence, and IQ stanzas provide basic semantics for messaging, availability, and request-response interactions, XMPP uses XML namespaces (see <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>) to extend the basic stanza syntax for the purpose of providing additional functionality. | ||
5204 | </p> | ||
5205 | <p>A message or presence stanza MAY contain one or more optional child elements specifying content that extends the meaning of the message (e.g., an XHTML-formatted version of the message body as described in <a class='info' href='#XEP-0071'>[XEP‑0071]<span> (</span><span class='info'>Saint-Andre, P., “XHTML-IM,” September 2008.</span><span>)</span></a>), and an IQ stanza of type "get" or "set" MUST contain one such child element. Such a child element MAY have any name and MUST possess a namespace declaration (other than "jabber:client", "jabber:server", or "http://etherx.jabber.org/streams") that defines the data contained within the child element. Such a child element is called an "extension element". An extension element can be included either at the direct child level of the stanza or in any mix of levels. | ||
5206 | </p> | ||
5207 | <p>Similarly, "extension attributes" are allowed. That is: a stanza itself (i.e., an <iq/>, <message/>, or <presence/> element qualified by the "jabber:client" or "jabber:server" content namespace) or any child element of such a stanza (whether an extension element or a child element qualified by the content namespace) MAY also include one or more attributes qualified by XML namespaces other than the content namespace or the reserved "http://www.w3.org/XML/1998/namespace" namespace (including the so-called "empty namespace" if the attribute is not prefixed as described under <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>). | ||
5208 | </p> | ||
5209 | <p></p> | ||
5210 | <blockquote class="text"> | ||
5211 | <p>Interoperability Note: For the sake of backward compatibility and maximum interoperability, an entity that generates a stanza SHOULD NOT include such attributes in the stanza itself or in child elements of the stanza that are qualified by the content namespaces "jabber:client" or "jabber:server" (e.g., the <body/> child of the <message/> stanza). | ||
5212 | </p> | ||
5213 | </blockquote> | ||
5214 | |||
5215 | <p>An extension element or extension attribute is said to be "extended content" and the qualifying namespace for such an element or attribute is said to be an "extended namespace". | ||
5216 | </p> | ||
5217 | <p></p> | ||
5218 | <blockquote class="text"> | ||
5219 | <p>Informational Note: Although extended namespaces for XMPP are commonly defined by the XMPP Standards Foundation (XSF) and by the IETF, no specification or IETF standards action is necessary to define extended namespaces, and any individual or organization is free to define XMPP extensions. | ||
5220 | </p> | ||
5221 | </blockquote> | ||
5222 | |||
5223 | <p>To illustrate these concepts, several examples follow. | ||
5224 | </p> | ||
5225 | <p>The following stanza contains one direct child element whose extended namespace is 'jabber:iq:roster': | ||
5226 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5227 | <iq from='juliet@capulet.com/balcony' | ||
5228 | id='h83vxa4c' | ||
5229 | type='get'> | ||
5230 | <query xmlns='jabber:iq:roster'/> | ||
5231 | </iq> | ||
5232 | </pre></div> | ||
5233 | <p>The following stanza contains two direct child elements with two different extended namespaces. | ||
5234 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5235 | <presence from='juliet@capulet.com/balcony'> | ||
5236 | <c xmlns='http://jabber.org/protocol/caps' | ||
5237 | hash='sha-1' | ||
5238 | node='http://code.google.com/p/exodus' | ||
5239 | ver='QgayPKawpkPSDYmwT/WM94uAlu0='/> | ||
5240 | <x xmlns='vcard-temp:x:update'> | ||
5241 | <photo>sha1-hash-of-image</photo> | ||
5242 | </x> | ||
5243 | </presence> | ||
5244 | </pre></div> | ||
5245 | <p>The following stanza contains two child elements, one of which is qualified by the "jabber:client" or "jabber:server" content namespace and one of which is qualified by an extended namespace; the extension element in turn contains a child element that is qualified by a different extended namespace. | ||
5246 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5247 | <message to='juliet@capulet.com'> | ||
5248 | <body>Hello?</body> | ||
5249 | <html xmlns='http://jabber.org/protocol/xhtml-im'> | ||
5250 | <body xmlns='http://www.w3.org/1999/xhtml'> | ||
5251 | <p style='font-weight:bold'>Hello?</p> | ||
5252 | </body> | ||
5253 | </html> | ||
5254 | </message> | ||
5255 | </pre></div> | ||
5256 | <p>It is conventional in the XMPP community for implementations to not generate namespace prefixes for elements that are qualified by extended namespaces (in the XML community, this convention is sometimes called "prefix-free canonicalization"). However, if an implementation generates such namespace prefixes then it MUST include the namespace declaration in the stanza itself or a child element of the stanza, not in the stream header (see <a class='info' href='#streams-ns-other'>Section 4.8.4<span> (</span><span class='info'>Other Namespaces</span><span>)</span></a>). | ||
5257 | </p> | ||
5258 | <p>Routing entities (typically servers) SHOULD try to maintain prefixes when serializing XML stanzas for processing, but receiving entities MUST NOT depend on the prefix strings to have any particular value (the allowance for the 'stream' prefix, described under <a class='info' href='#streams-ns-declarations'>Section 4.8.5<span> (</span><span class='info'>Namespace Declarations and Prefixes</span><span>)</span></a>, is an exception to this rule, albeit for streams rather than stanzas). | ||
5259 | </p> | ||
5260 | <p>Support for any given extended namespace is OPTIONAL on the part of any implementation. If an entity does not understand such a namespace, the entity's expected behavior depends on whether the entity is (1) the recipient or (2) a server that is routing or delivering the stanza to the recipient. | ||
5261 | </p> | ||
5262 | <p>If a recipient receives a stanza that contains an element or attribute it does not understand, it MUST NOT attempt to process that XML data and instead MUST proceed as follows. | ||
5263 | </p> | ||
5264 | <p> | ||
5265 | </p> | ||
5266 | <ul class="text"> | ||
5267 | <li>If an intended recipient receives a message stanza whose only child element is qualified by a namespace it does not understand, then depending on the XMPP application it MUST either ignore the entire stanza or return a stanza error, which SHOULD be <service-unavailable/> (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>). | ||
5268 | </li> | ||
5269 | <li>If an intended recipient receives a presence stanza whose only child element is qualified by a namespace it does not understand, then it MUST ignore the child element by treating the presence stanza as if it contained no child element. | ||
5270 | </li> | ||
5271 | <li>If an intended recipient receives a message or presence stanza that contains XML data qualified by a namespace it does not understand, then it MUST ignore the portion of the stanza qualified by the unknown namespace. | ||
5272 | </li> | ||
5273 | <li>If an intended recipient receives an IQ stanza of type "get" or "set" containing a child element qualified by a namespace it does not understand, then the entity MUST return an IQ stanza of type "error" with an error condition of <service-unavailable/>. | ||
5274 | </li> | ||
5275 | </ul><p> | ||
5276 | |||
5277 | </p> | ||
5278 | <p>If a server handles a stanza that is intended for delivery to another entity and that contains a child element it does not understand, it MUST route the stanza unmodified to a remote server or deliver the stanza unmodified to a connected client associated with a local account. | ||
5279 | </p> | ||
5280 | <a name="examples"></a><br /><hr /> | ||
5281 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5282 | <a name="rfc.section.9"></a><h3>9. | ||
5283 | Detailed Examples</h3> | ||
5284 | |||
5285 | <p>The detailed examples in this section further illustrate the protocols defined in this specification. | ||
5286 | </p> | ||
5287 | <a name="examples-c2s"></a><br /><hr /> | ||
5288 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5289 | <a name="rfc.section.9.1"></a><h3>9.1. | ||
5290 | Client-to-Server Examples</h3> | ||
5291 | |||
5292 | <p>The following examples show the XMPP data flow for a client | ||
5293 | negotiating an XML stream with a server, exchanging XML stanzas, and closing | ||
5294 | the negotiated stream. The server is "im.example.com", the server requires use | ||
5295 | of TLS, the client authenticates via the SASL SCRAM-SHA-1 mechanism as | ||
5296 | <juliet@im.example.com> with a password of | ||
5297 | "r0m30myr0m30", and the client binds a client-submitted resource to the stream. It is assumed that before sending the initial stream header, the client has already resolved an SRV record of _xmpp‑client._tcp.im.example.com and has opened a TCP connection to the advertised port at the resolved IP address. | ||
5298 | </p> | ||
5299 | <a name="examples-c2s-tls"></a><br /><hr /> | ||
5300 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5301 | <a name="rfc.section.9.1.1"></a><h3>9.1.1. | ||
5302 | TLS</h3> | ||
5303 | |||
5304 | <p>Step 1: Client initiates stream to server: | ||
5305 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5306 | C: <stream:stream | ||
5307 | from='juliet@im.example.com' | ||
5308 | to='im.example.com' | ||
5309 | version='1.0' | ||
5310 | xml:lang='en' | ||
5311 | xmlns='jabber:client' | ||
5312 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5313 | </pre></div> | ||
5314 | <p>Step 2: Server responds by sending a response stream header to client: | ||
5315 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5316 | S: <stream:stream | ||
5317 | from='im.example.com' | ||
5318 | id='t7AMCin9zjMNwQKDnplntZPIDEI=' | ||
5319 | to='juliet@im.example.com' | ||
5320 | version='1.0' | ||
5321 | xml:lang='en' | ||
5322 | xmlns='jabber:client' | ||
5323 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5324 | </pre></div> | ||
5325 | <p>Step 3: Server sends stream features to client (only the STARTTLS extension at this point, which is mandatory-to-negotiate): | ||
5326 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5327 | S: <stream:features> | ||
5328 | <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> | ||
5329 | <required/> | ||
5330 | </starttls> | ||
5331 | </stream:features> | ||
5332 | </pre></div> | ||
5333 | <p>Step 4: Client sends STARTTLS command to server: | ||
5334 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5335 | C: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5336 | </pre></div> | ||
5337 | <p>Step 5: Server informs client that it is allowed to proceed: | ||
5338 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5339 | S: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5340 | </pre></div> | ||
5341 | <p>Step 5 (alt): Server informs client that STARTTLS negotiation has failed, closes the XML stream, and terminates the TCP connection (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5342 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5343 | S: <failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5344 | </stream:stream> | ||
5345 | </pre></div> | ||
5346 | <p>Step 6: Client and server attempt to complete TLS negotiation over the existing TCP connection (see <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a> for details). | ||
5347 | </p> | ||
5348 | <p>Step 7: If TLS negotiation is successful, client initiates a new stream to server over the TLS-protected TCP connection: | ||
5349 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5350 | C: <stream:stream | ||
5351 | from='juliet@im.example.com' | ||
5352 | to='im.example.com' | ||
5353 | version='1.0' | ||
5354 | xml:lang='en' | ||
5355 | xmlns='jabber:client' | ||
5356 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5357 | </pre></div> | ||
5358 | <p>Step 7 (alt): If TLS negotiation is unsuccessful, server closes TCP connection (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5359 | </p> | ||
5360 | <a name="examples-c2s-sasl"></a><br /><hr /> | ||
5361 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5362 | <a name="rfc.section.9.1.2"></a><h3>9.1.2. | ||
5363 | SASL</h3> | ||
5364 | |||
5365 | <p>Step 8: Server responds by sending a stream header to client along with any available stream features: | ||
5366 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5367 | S: <stream:stream | ||
5368 | from='im.example.com' | ||
5369 | id='vgKi/bkYME8OAj4rlXMkpucAqe4=' | ||
5370 | to='juliet@im.example.com' | ||
5371 | version='1.0' | ||
5372 | xml:lang='en' | ||
5373 | xmlns='jabber:client' | ||
5374 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5375 | |||
5376 | S: <stream:features> | ||
5377 | <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
5378 | <mechanism>SCRAM-SHA-1-PLUS</mechanism> | ||
5379 | <mechanism>SCRAM-SHA-1</mechanism> | ||
5380 | <mechanism>PLAIN</mechanism> | ||
5381 | </mechanisms> | ||
5382 | </stream:features> | ||
5383 | </pre></div> | ||
5384 | <p>Step 9: Client selects an authentication mechanism | ||
5385 | (in this case, SCRAM-SHA-1), including initial response data: | ||
5386 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5387 | C: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" | ||
5388 | mechanism="SCRAM-SHA-1"> | ||
5389 | biwsbj1qdWxpZXQscj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQQ== | ||
5390 | </auth> | ||
5391 | </pre></div> | ||
5392 | <p>The decoded base 64 data is "n,,n=juliet,r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0AA". | ||
5393 | </p> | ||
5394 | <p>Step 10: Server sends a challenge: | ||
5395 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5396 | S: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> | ||
5397 | cj1vTXNUQUF3QUFBQU1BQUFBTlAwVEFBQUFBQUJQVTBBQWUxMjQ2OTViLTY5Y | ||
5398 | TktNGRlNi05YzMwLWI1MWIzODA4YzU5ZSxzPU5qaGtZVE0wTURndE5HWTBaaT | ||
5399 | AwTmpkbUxUa3hNbVV0TkRsbU5UTm1ORE5rTURNeixpPTQwOTY= | ||
5400 | </challenge> | ||
5401 | </pre></div> | ||
5402 | <p>The decoded base 64 data is "r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0AAe124695b-69a9-4de6-9c30-b51b3808c59e,s=NjhkYTM0MDgtNGY0Zi00NjdmLTkxMmUtNDlmNTNmNDNkMDMz,i=4096" (line breaks not included in actual data). | ||
5403 | </p> | ||
5404 | <p>Step 11: Client sends a response: | ||
5405 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5406 | C: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> | ||
5407 | Yz1iaXdzLHI9b01zVEFBd0FBQUFNQUFBQU5QMFRBQUFBQUFCUFUwQUFlMTI0N | ||
5408 | jk1Yi02OWE5LTRkZTYtOWMzMC1iNTFiMzgwOGM1OWUscD1VQTU3dE0vU3ZwQV | ||
5409 | RCa0gyRlhzMFdEWHZKWXc9 | ||
5410 | </response> | ||
5411 | </pre></div> | ||
5412 | <p> | ||
5413 | The decoded base 64 data is "c=biws,r=oMsTAAwAAAAMAAAANP0TAAAAAABPU0 | ||
5414 | AAe124695b-69a9-4de6-9c30-b51b3808c59e,p=UA57tM/ | ||
5415 | SvpATBkH2FXs0WDXvJYw=" (line breaks not included in actual data). | ||
5416 | |||
5417 | </p> | ||
5418 | <p>Step 12: Server informs client of success, including additional data with success: | ||
5419 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5420 | S: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
5421 | dj1wTk5ERlZFUXh1WHhDb1NFaVc4R0VaKzFSU289 | ||
5422 | </success> | ||
5423 | </pre></div> | ||
5424 | <p>The decoded base 64 data is "v=pNNDFVEQxuXxCoSEiW8GEZ+1RSo=". | ||
5425 | </p> | ||
5426 | <p>Step 12 (alt): Server returns a SASL error to client (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5427 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5428 | S: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
5429 | <not-authorized/> | ||
5430 | </failure> | ||
5431 | </stream> | ||
5432 | </pre></div> | ||
5433 | <p>Step 13: Client initiates a new stream to server: | ||
5434 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5435 | C: <stream:stream | ||
5436 | from='juliet@im.example.com' | ||
5437 | to='im.example.com' | ||
5438 | version='1.0' | ||
5439 | xml:lang='en' | ||
5440 | xmlns='jabber:client' | ||
5441 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5442 | </pre></div> | ||
5443 | <a name="examples-c2s-bind"></a><br /><hr /> | ||
5444 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5445 | <a name="rfc.section.9.1.3"></a><h3>9.1.3. | ||
5446 | Resource Binding</h3> | ||
5447 | |||
5448 | <p>Step 14: Server responds by sending a stream header to client along with supported features (in this case, resource binding): | ||
5449 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5450 | S: <stream:stream | ||
5451 | from='im.example.com' | ||
5452 | id='gPybzaOzBmaADgxKXu9UClbprp0=' | ||
5453 | to='juliet@im.example.com' | ||
5454 | version='1.0' | ||
5455 | xml:lang='en' | ||
5456 | xmlns='jabber:client' | ||
5457 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5458 | |||
5459 | S: <stream:features> | ||
5460 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/> | ||
5461 | </stream:features> | ||
5462 | </pre></div> | ||
5463 | <p>Upon being informed that resource binding is mandatory-to-negotiate, the client needs to bind a resource to the stream; here we assume that the client submits a human-readable text string. | ||
5464 | </p> | ||
5465 | <p>Step 15: Client binds a resource: | ||
5466 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5467 | C: <iq id='yhc13a95' type='set'> | ||
5468 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
5469 | <resource>balcony</resource> | ||
5470 | </bind> | ||
5471 | </iq> | ||
5472 | </pre></div> | ||
5473 | <p>Step 16: Server accepts submitted resourcepart and informs client of successful resource binding: | ||
5474 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5475 | S: <iq id='yhc13a95' type='result'> | ||
5476 | <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> | ||
5477 | <jid> | ||
5478 | juliet@im.example.com/balcony | ||
5479 | </jid> | ||
5480 | </bind> | ||
5481 | </iq> | ||
5482 | </pre></div> | ||
5483 | <p>Step 16 (alt): Server returns error to client (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5484 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5485 | S: <iq id='yhc13a95' type='error'> | ||
5486 | <error type='cancel'> | ||
5487 | <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
5488 | </error> | ||
5489 | </iq> | ||
5490 | </pre></div> | ||
5491 | <a name="examples-c2s-stanzas"></a><br /><hr /> | ||
5492 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5493 | <a name="rfc.section.9.1.4"></a><h3>9.1.4. | ||
5494 | Stanza Exchange</h3> | ||
5495 | |||
5496 | <p>Now the client is allowed to send XML stanzas over the negotiated stream. | ||
5497 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5498 | C: <message from='juliet@im.example.com/balcony' | ||
5499 | id='ju2ba41c' | ||
5500 | to='romeo@example.net' | ||
5501 | type='chat' | ||
5502 | xml:lang='en'> | ||
5503 | <body>Art thou not Romeo, and a Montague?</body> | ||
5504 | </message> | ||
5505 | </pre></div> | ||
5506 | <p>If necessary, sender's server negotiates XML streams with intended recipient's server (see <a class='info' href='#examples-s2s'>Section 9.2<span> (</span><span class='info'>Server-to-Server Examples</span><span>)</span></a>). | ||
5507 | </p> | ||
5508 | <p>The intended recipient replies, and the message is delivered to the client. | ||
5509 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5510 | E: <message from='romeo@example.net/orchard' | ||
5511 | id='ju2ba41c' | ||
5512 | to='juliet@im.example.com/balcony' | ||
5513 | type='chat' | ||
5514 | xml:lang='en'> | ||
5515 | <body>Neither, fair saint, if either thee dislike.</body> | ||
5516 | </message> | ||
5517 | </pre></div> | ||
5518 | <p>The client can subsequently send and receive an unbounded number of subsequent XML stanzas over the stream. | ||
5519 | </p> | ||
5520 | <a name="examples-c2s-close"></a><br /><hr /> | ||
5521 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5522 | <a name="rfc.section.9.1.5"></a><h3>9.1.5. | ||
5523 | Close</h3> | ||
5524 | |||
5525 | <p>Desiring to send no further messages, the client closes its stream to the server but waits for incoming data from the server. | ||
5526 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5527 | C: </stream:stream> | ||
5528 | </pre></div> | ||
5529 | <p>Consistent with <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>, the server might send additional data to the client and then closes its stream to the client. | ||
5530 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5531 | S: </stream:stream> | ||
5532 | </pre></div> | ||
5533 | <p>The client now sends a TLS close_notify alert, receives a responding close_notify alert from the server, and then terminates the underlying TCP connection. | ||
5534 | </p> | ||
5535 | <a name="examples-s2s"></a><br /><hr /> | ||
5536 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5537 | <a name="rfc.section.9.2"></a><h3>9.2. | ||
5538 | Server-to-Server Examples</h3> | ||
5539 | |||
5540 | <p>The following examples show the data flow for a server negotiating an XML stream with a peer server, exchanging XML stanzas, and closing the negotiated stream. The initiating server ("Server1") is im.example.com; the receiving server ("Server2") is example.net and it requires use of TLS; im.example.com presents a certificate and authenticates via the SASL EXTERNAL mechanism. It is assumed that before sending the initial stream header, Server1 has already resolved an SRV record of _xmpp-server._tcp.example.net and has opened a TCP connection to the advertised port at the resolved IP address. Note how Server1 declares the content namespace "jabber:server" as the default namespace and uses prefixes for stream-related elements, whereas Server2 uses prefix-free canonicalization. | ||
5541 | </p> | ||
5542 | <a name="examples-s2s-tls"></a><br /><hr /> | ||
5543 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5544 | <a name="rfc.section.9.2.1"></a><h3>9.2.1. | ||
5545 | TLS</h3> | ||
5546 | |||
5547 | <p>Step 1: Server1 initiates stream to Server2: | ||
5548 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5549 | S1: <stream:stream | ||
5550 | from='im.example.com' | ||
5551 | to='example.net' | ||
5552 | version='1.0' | ||
5553 | xmlns='jabber:server' | ||
5554 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5555 | </pre></div> | ||
5556 | <p>Step 2: Server2 responds by sending a response stream header to Server1: | ||
5557 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5558 | S2: <stream | ||
5559 | from='example.net' | ||
5560 | id='hTiXkW+ih9k2SqdGkk/AZi0OJ/Q=' | ||
5561 | to='im.example.com' | ||
5562 | version='1.0' | ||
5563 | xmlns='http://etherx.jabber.org/streams'> | ||
5564 | </pre></div> | ||
5565 | <p>Step 3: Server2 sends stream features to Server1 (only the STARTTLS extension at this point, which is mandatory-to-negotiate): | ||
5566 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5567 | S2: <features xmlns='http://etherx.jabber.org/streams'> | ||
5568 | <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'> | ||
5569 | <required/> | ||
5570 | </starttls> | ||
5571 | </features> | ||
5572 | </pre></div> | ||
5573 | <p>Step 4: Server1 sends the STARTTLS command to Server2: | ||
5574 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5575 | S1: <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5576 | </pre></div> | ||
5577 | <p>Step 5: Server2 informs Server1 that it is allowed to proceed: | ||
5578 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5579 | S2: <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5580 | </pre></div> | ||
5581 | <p>Step 5 (alt): Server2 informs Server1 that STARTTLS negotiation has failed, closes the stream, and terminates the TCP connection (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5582 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5583 | S2: <failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
5584 | </stream> | ||
5585 | </pre></div> | ||
5586 | <p>Step 6: Server1 and Server2 attempt to complete TLS negotiation via TCP (see <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a> for details). | ||
5587 | </p> | ||
5588 | <p>Step 7: If TLS negotiation is successful, Server1 initiates a new stream to Server2 over the TLS-protected TCP connection: | ||
5589 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5590 | S1: <stream:stream | ||
5591 | from='im.example.com' | ||
5592 | to='example.net' | ||
5593 | version='1.0' | ||
5594 | xmlns='jabber:server' | ||
5595 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5596 | </pre></div> | ||
5597 | <p>Step 7 (alt): If TLS negotiation is unsuccessful, Server2 | ||
5598 | closes the TCP connection (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step). | ||
5599 | </p> | ||
5600 | <a name="examples-s2s-sasl"></a><br /><hr /> | ||
5601 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5602 | <a name="rfc.section.9.2.2"></a><h3>9.2.2. | ||
5603 | SASL</h3> | ||
5604 | |||
5605 | <p>Step 8: Server2 sends a response stream header to Server1 along with available stream features (including a preference for the SASL EXTERNAL mechanism): | ||
5606 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5607 | S2: <stream | ||
5608 | from='example.net' | ||
5609 | id='RChdjlgj/TIBcbT9Keu31zDihH4=' | ||
5610 | to='im.example.com' | ||
5611 | version='1.0' | ||
5612 | xmlns='http://etherx.jabber.org/streams'> | ||
5613 | |||
5614 | S2: <features xmlns='http://etherx.jabber.org/streams'> | ||
5615 | <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
5616 | <mechanism>EXTERNAL</mechanism> | ||
5617 | </mechanisms> | ||
5618 | </features> | ||
5619 | </pre></div> | ||
5620 | <p>Step 9: Server1 selects the EXTERNAL mechanism (including an empty response of "="): | ||
5621 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5622 | S1: <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
5623 | mechanism='EXTERNAL'>=</auth> | ||
5624 | </pre></div> | ||
5625 | <p>Step 10: Server2 returns success: | ||
5626 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5627 | S2: <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/> | ||
5628 | </pre></div> | ||
5629 | <p>Step 10 (alt): Server2 informs Server1 of failed authentication (thus, the stream negotiation process ends unsuccessfully and the parties do not move on to the next step): | ||
5630 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5631 | S2: <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> | ||
5632 | <not-authorized/> | ||
5633 | </failure> | ||
5634 | </stream> | ||
5635 | </pre></div> | ||
5636 | <p>Step 11: Server1 initiates a new stream to Server2: | ||
5637 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5638 | S1: <stream:stream | ||
5639 | from='im.example.com' | ||
5640 | to='example.net' | ||
5641 | version='1.0' | ||
5642 | xmlns='jabber:server' | ||
5643 | xmlns:stream='http://etherx.jabber.org/streams'> | ||
5644 | </pre></div> | ||
5645 | <p>Step 12: Server2 responds by sending a stream header to Server1 along with any additional features (or, in this case, an empty features element): | ||
5646 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5647 | S2: <stream | ||
5648 | from='example.net' | ||
5649 | id='MbbV2FeojySpUIP6J91qaa+TWHM=' | ||
5650 | to='im.example.com' | ||
5651 | version='1.0' | ||
5652 | xmlns='http://etherx.jabber.org/streams'> | ||
5653 | |||
5654 | S2: <features xmlns='http://etherx.jabber.org/streams'/> | ||
5655 | </pre></div> | ||
5656 | <a name="examples-s2s-stanzas"></a><br /><hr /> | ||
5657 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5658 | <a name="rfc.section.9.2.3"></a><h3>9.2.3. | ||
5659 | Stanza Exchange</h3> | ||
5660 | |||
5661 | <p>Now Server1 is allowed to send XML stanzas to Server2 over the negotiated stream from im.example.com to example.net; here we assume that the transferred stanzas are those shown earlier for client-to-server communication, albeit over a server-to-server stream qualified by the 'jabber:server' namespace. | ||
5662 | </p> | ||
5663 | <p>Server1 sends XML stanza to Server2: | ||
5664 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5665 | S1: <message from='juliet@im.example.com/balcony' | ||
5666 | id='ju2ba41c' | ||
5667 | to='romeo@example.net' | ||
5668 | type='chat' | ||
5669 | xml:lang='en'> | ||
5670 | <body>Art thou not Romeo, and a Montague?</body> | ||
5671 | </message> | ||
5672 | </pre></div> | ||
5673 | <a name="examples-s2s-close"></a><br /><hr /> | ||
5674 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5675 | <a name="rfc.section.9.2.4"></a><h3>9.2.4. | ||
5676 | Close</h3> | ||
5677 | |||
5678 | <p>Desiring to send no further messages, Server1 closes its stream to Server2 but waits for incoming data from Server2. (In practice, the stream would most likely remain open for some time, since Server1 and Server2 do not immediately know if the stream will be needed for further communication.) | ||
5679 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5680 | S1: </stream:stream> | ||
5681 | </pre></div> | ||
5682 | <p>Consistent with the recommended stream closing handshake, Server2 closes the stream as well: | ||
5683 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
5684 | S2: </stream> | ||
5685 | </pre></div> | ||
5686 | <p>Server1 now sends a TLS close_notify alert, receives a responding close_notify alert from Server2, and then terminates the underlying TCP connection. | ||
5687 | </p> | ||
5688 | <a name="rules"></a><br /><hr /> | ||
5689 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5690 | <a name="rfc.section.10"></a><h3>10. | ||
5691 | Server Rules for Processing XML Stanzas</h3> | ||
5692 | |||
5693 | <p>Each server implementation will contain its own logic for processing stanzas it receives. Such logic determines whether the server needs to route a given stanza to another domain, deliver it to a local entity (typically a connected client associated with a local account), or handle it directly within the server itself. This section provides general rules for processing XML stanzas. However, particular XMPP applications MAY specify delivery rules that modify or supplement the following rules (e.g., a set of delivery rules for instant messaging and presence applications is defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
5694 | </p> | ||
5695 | <a name="rules-order"></a><br /><hr /> | ||
5696 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5697 | <a name="rfc.section.10.1"></a><h3>10.1. | ||
5698 | In-Order Processing</h3> | ||
5699 | |||
5700 | <p>An XMPP server MUST ensure in-order processing of the stanzas and other XML elements it receives over a given input stream from a connected client or remote server. | ||
5701 | </p> | ||
5702 | <p>In-order processing applies (a) to any XML elements used to negotiate and manage XML streams, and (b) to all uses of XML stanzas, including but not limited to the following: | ||
5703 | </p> | ||
5704 | <p> | ||
5705 | </p> | ||
5706 | <ol class="text"> | ||
5707 | <li>Stanzas sent by a client to its server or to its own bare JID for direct processing by the server (e.g., in-order processing of a roster get and initial presence as described in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
5708 | </li> | ||
5709 | <li>Stanzas sent by a connected client and intended for delivery to another entity associated with the server (e.g., stanzas addressed from <juliet@im.example.com> to <nurse@im.example.com>). The server MUST ensure that it delivers stanzas addressed to the intended recipient in the order it receives them over the input stream from the sending client, treating stanzas addressed to the bare JID and the full JID of the intended recipient as equivalent for delivery purposes. | ||
5710 | </li> | ||
5711 | <li>Stanzas sent by a connected client and intended for delivery to an entity located at a remote domain (e.g., stanzas addressed from <juliet@im.example.com> to <romeo@example.net>). The routing server MUST ensure that it routes stanzas addressed to the intended recipient in the order it receives them over the input stream from the sending client, treating stanzas addressed to the bare JID and the full JID of the intended recipient as equivalent for routing purposes. To help ensure in-order processing, the routing server MUST route such stanzas over a single output stream to the remote domain, rather than sending some stanzas over one server-to-server stream and other stanzas over another server-to-server stream. | ||
5712 | </li> | ||
5713 | <li>Stanzas routed from one server to another server for delivery to an entity associated with the remote domain (e.g., stanzas addressed from <juliet@im.example.com> to <romeo@example.net> and routed by <im.example.com> over a server-to-server stream to <example.net>). The delivering server MUST ensure that it delivers stanzas to the intended recipient in the order it receives them over the input stream from the routing server, treating stanzas addressed to the bare JID and the full JID of the intended recipient as equivalent for delivery purposes. | ||
5714 | </li> | ||
5715 | <li>Stanzas sent by one server to another server for direct processing by the server that is hosting the remote domain (e.g., stanzas addressed from <im.example.com> to <example.net>). | ||
5716 | </li> | ||
5717 | </ol><p> | ||
5718 | |||
5719 | </p> | ||
5720 | <p>If the server's processing of a particular request could have an effect on its processing of subsequent data it might receive over that input stream (e.g., enforcement of communication policies), it MUST suspend processing of subsequent data until it has processed the request. | ||
5721 | </p> | ||
5722 | <p>In-order processing applies only to a single input stream. Therefore, a server is not responsible for ensuring the coherence of data it receives across multiple input streams associated with the same local account (e.g., stanzas received over two different input streams from <juliet@im.example.com/balcony> and <juliet@im.example.com/chamber>) or the same remote domain (e.g., two different input streams negotiated by a remote domain; however, a server MAY close the stream with a <conflict/> stream error (<a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>) if a remote server attempts to negotiate more than one stream, as described under <a class='info' href='#streams-error-conditions-conflict'>Section 4.9.3.3<span> (</span><span class='info'>conflict</span><span>)</span></a>). | ||
5723 | </p> | ||
5724 | <a name="rules-gen"></a><br /><hr /> | ||
5725 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5726 | <a name="rfc.section.10.2"></a><h3>10.2. | ||
5727 | General Considerations</h3> | ||
5728 | |||
5729 | <p>At high level, there are three primary considerations at play in server processing of XML stanzas, which sometimes are at odds but need to be managed in a consistent way: | ||
5730 | </p> | ||
5731 | <p> | ||
5732 | </p> | ||
5733 | <ol class="text"> | ||
5734 | <li>It is good to deliver a stanza to the intended recipient if possible. | ||
5735 | </li> | ||
5736 | <li>If a stanza cannot be delivered, it is helpful to inform the sender. | ||
5737 | </li> | ||
5738 | <li>It is bad to facilitate directory harvesting attacks (<a class='info' href='#security-harvesting'>Section 13.11<span> (</span><span class='info'>Directory Harvesting</span><span>)</span></a>) and presence leaks (<a class='info' href='#security-leaks-presence'>Section 13.10.2<span> (</span><span class='info'>Presence Information</span><span>)</span></a>). | ||
5739 | </li> | ||
5740 | </ol><p> | ||
5741 | |||
5742 | </p> | ||
5743 | <p>With regard to possible delivery-related attacks, the following points need to be kept in mind: | ||
5744 | </p> | ||
5745 | <p> | ||
5746 | </p> | ||
5747 | <ol class="text"> | ||
5748 | <li>From the perspective of an attacker, there is little if any effective difference between the server's (i) delivering the stanza or storing it offline for later delivery (see <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>) and (ii) silently ignoring it (because an error is not returned immediately in any of those cases); therefore, in scenarios where a server delivers a stanza or places the stanza into offline storage for later delivery, it needs to silently ignore the stanza if that account does not exist. | ||
5749 | </li> | ||
5750 | <li>How a server processes stanzas sent to the bare JID <localpart@domainpart> has implications for directory harvesting, because an attacker could determine whether an account exists if the server responds differently depending on whether there is an account for a given bare JID. | ||
5751 | </li> | ||
5752 | <li>How a server processes stanzas sent to a full JID has implications for presence leaks, because an attacker could send requests to multiple full JIDs and receive different replies depending on whether the user has a device currently online at that full JID. The use of randomized resourceparts (whether generated by the client or the server as described under <a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a>) significantly helps to mitigate this attack, so it is of somewhat lesser concern than the directory harvesting attack. | ||
5753 | </li> | ||
5754 | </ol><p> | ||
5755 | |||
5756 | </p> | ||
5757 | <p>Naturally, presence is not leaked if the entity to which a user's server returns an error already knows the user's presence or is authorized to do so (e.g., by means of a presence subscription or directed presence), and a server does not enable a directory harvesting attack if it returns an error to an entity that already knows if a user exists (e.g., because the entity is in the user's contact list); these matters are discussed more fully in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>. | ||
5758 | </p> | ||
5759 | <a name="rules-noto"></a><br /><hr /> | ||
5760 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5761 | <a name="rfc.section.10.3"></a><h3>10.3. | ||
5762 | No 'to' Address</h3> | ||
5763 | |||
5764 | <p>If the stanza possesses no 'to' attribute, the server MUST handle it directly on behalf of the entity that sent it, where the meaning of "handle it directly" depends on whether the stanza is message, presence, or IQ. Because all stanzas received from other servers MUST possess a 'to' attribute, this rule applies only to stanzas received from a local entity (typically a client) that is connected to the server. | ||
5765 | </p> | ||
5766 | <a name="rules-noto-message"></a><br /><hr /> | ||
5767 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5768 | <a name="rfc.section.10.3.1"></a><h3>10.3.1. | ||
5769 | Message</h3> | ||
5770 | |||
5771 | <p>If the server receives a message stanza with no 'to' attribute, it MUST treat the message as if the 'to' address were the bare JID <localpart@domainpart> of the sending entity. | ||
5772 | </p> | ||
5773 | <a name="rules-noto-presence"></a><br /><hr /> | ||
5774 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5775 | <a name="rfc.section.10.3.2"></a><h3>10.3.2. | ||
5776 | Presence</h3> | ||
5777 | |||
5778 | <p>If the server receives a presence stanza with no 'to' attribute, it MUST broadcast it to the entities that are subscribed to the sending entity's presence, if applicable (<a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a> defines the semantics of such broadcasting for presence applications). | ||
5779 | </p> | ||
5780 | <a name="rules-noto-IQ"></a><br /><hr /> | ||
5781 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5782 | <a name="rfc.section.10.3.3"></a><h3>10.3.3. | ||
5783 | IQ</h3> | ||
5784 | |||
5785 | <p>If the server receives an IQ stanza with no 'to' attribute, it MUST process the stanza on behalf of the account from which received the stanza, as follows: | ||
5786 | </p> | ||
5787 | <p> | ||
5788 | </p> | ||
5789 | <ol class="text"> | ||
5790 | <li>If the IQ stanza is of type "get" or "set" and the server understands the namespace that qualifies the payload, the server MUST handle the stanza on behalf of the sending entity or return an appropriate error to the sending entity. Although the meaning of "handle" is determined by the semantics of the qualifying namespace, in general the server will respond to the IQ stanza of type "get" or "set" by returning an appropriate IQ stanza of type "result" or "error", responding as if the server were the bare JID of the sending entity. As an example, if the sending entity sends an IQ stanza of type "get" where the payload is qualified by the 'jabber:iq:roster' namespace (as described in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>), then the server will return the roster associated with the sending entity's bare JID to the particular resource of the sending entity that requested the roster. | ||
5791 | </li> | ||
5792 | <li>If the IQ stanza is of type "get" or "set" and the server does not understand the namespace that qualifies the payload, the server MUST return an error to the sending entity, which MUST be <service-unavailable/>. | ||
5793 | </li> | ||
5794 | <li>If the IQ stanza is of type "error" or "result", the server MUST handle the error or result in accordance with the payload of the associated IQ stanza or type "get" or "set" (if there is no such associated stanza, the server MUST ignore the error or result stanza). | ||
5795 | </li> | ||
5796 | </ol><p> | ||
5797 | |||
5798 | </p> | ||
5799 | <a name="rules-remote"></a><br /><hr /> | ||
5800 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5801 | <a name="rfc.section.10.4"></a><h3>10.4. | ||
5802 | Remote Domain</h3> | ||
5803 | |||
5804 | <p>If the domainpart of the JID contained in the 'to' attribute does not match one of the configured FQDNs of the server, the server SHOULD attempt to route the stanza to the remote domain (subject to local service provisioning and security policies regarding inter-domain communication, since such communication is OPTIONAL for any given deployment). As described in the following sections, there are two possible cases. | ||
5805 | </p> | ||
5806 | <p></p> | ||
5807 | <blockquote class="text"> | ||
5808 | <p>Security Warning: These rules apply only client-to-server streams. As described under <a class='info' href='#stanzas-attributes-to-s2s'>Section 8.1.1.2<span> (</span><span class='info'>Server-to-Server Streams</span><span>)</span></a>, a server MUST NOT accept a stanza over a server-to-server stream if the domainpart of the JID in the 'to' attribute does not match an FQDN serviced by the receiving server. | ||
5809 | </p> | ||
5810 | </blockquote> | ||
5811 | |||
5812 | <a name="rules-remote-existing"></a><br /><hr /> | ||
5813 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5814 | <a name="rfc.section.10.4.1"></a><h3>10.4.1. | ||
5815 | Existing Stream</h3> | ||
5816 | |||
5817 | <p>If a server-to-server stream already exists between the two domains, the sender's server SHOULD attempt to route the stanza to the authoritative server for the remote domain over the existing stream. | ||
5818 | </p> | ||
5819 | <a name="rules-remote-nostream"></a><br /><hr /> | ||
5820 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5821 | <a name="rfc.section.10.4.2"></a><h3>10.4.2. | ||
5822 | No Existing Stream</h3> | ||
5823 | |||
5824 | <p>If there exists no server-to-server stream between the two domains, the sender's server will proceed as follows: | ||
5825 | </p> | ||
5826 | <p> | ||
5827 | </p> | ||
5828 | <ol class="text"> | ||
5829 | <li>Resolve the FQDN of the remote domain (as described under <a class='info' href='#security-reuse-dns'>Section 13.9.2<span> (</span><span class='info'>Use of DNS</span><span>)</span></a>). | ||
5830 | </li> | ||
5831 | <li>Negotiate a server-to-server stream between the two domains (as defined under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> and <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>). | ||
5832 | </li> | ||
5833 | <li>Route the stanza to the authoritative server for the remote domain over the newly established stream. | ||
5834 | </li> | ||
5835 | </ol><p> | ||
5836 | |||
5837 | </p> | ||
5838 | <a name="rules-remote-error"></a><br /><hr /> | ||
5839 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5840 | <a name="rfc.section.10.4.3"></a><h3>10.4.3. | ||
5841 | Error Handling</h3> | ||
5842 | |||
5843 | <p>If routing of a stanza to the intended recipient's server is unsuccessful, the sender's server MUST return an error to the sender. If resolution of the remote domain is unsuccessful, the stanza error MUST be <remote-server-not-found/> (<a class='info' href='#stanzas-error-conditions-remote-server-not-found'>Section 8.3.3.16<span> (</span><span class='info'>remote-server-not-found</span><span>)</span></a>). If resolution succeeds but streams cannot be negotiated, the stanza error MUST be <remote-server-timeout/> (<a class='info' href='#stanzas-error-conditions-remote-server-timeout'>Section 8.3.3.17<span> (</span><span class='info'>remote-server-timeout</span><span>)</span></a>). | ||
5844 | </p> | ||
5845 | <p>If stream negotiation with the intended recipient's server is successful but the remote server cannot deliver the stanza to the recipient, the remote server MUST return an appropriate error to the sender by way of the sender's server. | ||
5846 | </p> | ||
5847 | <a name="rules-local"></a><br /><hr /> | ||
5848 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5849 | <a name="rfc.section.10.5"></a><h3>10.5. | ||
5850 | Local Domain</h3> | ||
5851 | |||
5852 | <p>If the domainpart of the JID contained in the 'to' attribute matches one of the configured FQDNs of the server, the server MUST first determine if the FQDN is serviced by the server itself or by a specialized local service. If the latter, the server MUST route the stanza to that service. If the former, the server MUST proceed as follows. However, the server MUST NOT route or "forward" the stanza to another domain, because it is the server's responsibility to process all stanzas for which the domainpart of the 'to' address matches one of the configured FQDNs of the server (among other things, this helps to prevent looping). | ||
5853 | </p> | ||
5854 | <a name="rules-local-domain"></a><br /><hr /> | ||
5855 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5856 | <a name="rfc.section.10.5.1"></a><h3>10.5.1. | ||
5857 | domainpart</h3> | ||
5858 | |||
5859 | <p>If the JID contained in the 'to' attribute is of the form <domainpart>, then the server MUST either (a) handle the stanza as appropriate for the stanza kind or (b) return an error stanza to the sender. | ||
5860 | </p> | ||
5861 | <a name="rules-local-domainresource"></a><br /><hr /> | ||
5862 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5863 | <a name="rfc.section.10.5.2"></a><h3>10.5.2. | ||
5864 | domainpart/resourcepart</h3> | ||
5865 | |||
5866 | <p>If the JID contained in the 'to' attribute is of the form <domainpart/resourcepart>, then the server MUST either (a) handle the stanza as appropriate for the stanza kind or (b) return an error stanza to the sender. | ||
5867 | </p> | ||
5868 | <a name="rules-local-barejid"></a><br /><hr /> | ||
5869 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5870 | <a name="rfc.section.10.5.3"></a><h3>10.5.3. | ||
5871 | localpart@domainpart</h3> | ||
5872 | |||
5873 | <p>An address of this type is normally associated with an account on the server. The following rules provide some general guidelines; more detailed rules in the context of instant messaging and presence applications are provided in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>. | ||
5874 | </p> | ||
5875 | <a name="rules-local-barejid-nosuchuser"></a><br /><hr /> | ||
5876 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5877 | <a name="rfc.section.10.5.3.1"></a><h3>10.5.3.1. | ||
5878 | No Such User</h3> | ||
5879 | |||
5880 | <p>If there is no local account associated with the <localpart@domainpart>, how the stanza is processed depends on the stanza type. | ||
5881 | </p> | ||
5882 | <p> | ||
5883 | </p> | ||
5884 | <ul class="text"> | ||
5885 | <li>For a message stanza, the server MUST either (a) silently ignore the stanza or (b) return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>) to the sender. | ||
5886 | </li> | ||
5887 | <li>For a presence stanza, the server SHOULD ignore the stanza (or behave as described in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
5888 | </li> | ||
5889 | <li>For an IQ stanza, the server MUST return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>) to the sender. | ||
5890 | </li> | ||
5891 | </ul><p> | ||
5892 | |||
5893 | </p> | ||
5894 | <a name="rules-local-barejid-userexists"></a><br /><hr /> | ||
5895 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5896 | <a name="rfc.section.10.5.3.2"></a><h3>10.5.3.2. | ||
5897 | User Exists</h3> | ||
5898 | |||
5899 | <p>If the JID contained in the 'to' attribute is of the form <localpart@domainpart>, how the stanza is processed depends on the stanza type. | ||
5900 | </p> | ||
5901 | <p> | ||
5902 | </p> | ||
5903 | <ul class="text"> | ||
5904 | <li>For a message stanza, if there exists at least one connected resource for the account then the server SHOULD deliver it to at least one of the connected resources. If there exists no connected resource then the server MUST either (a) store the message offline for delivery when the account next has a connected resource or (b) return a <service-unavailable/> stanza error (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>). | ||
5905 | </li> | ||
5906 | <li>For a presence stanza, if there exists at least one connected resource that has sent initial presence (i.e., has a "presence session" as defined in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>) then the server SHOULD deliver it to such resources. If there exists no connected resource then the server SHOULD ignore the stanza (or behave as described in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>). | ||
5907 | </li> | ||
5908 | <li>For an IQ stanza, the server MUST handle it directly on behalf of the intended recipient. | ||
5909 | </li> | ||
5910 | </ul><p> | ||
5911 | |||
5912 | </p> | ||
5913 | <a name="rules-local-fulljid"></a><br /><hr /> | ||
5914 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5915 | <a name="rfc.section.10.5.4"></a><h3>10.5.4. | ||
5916 | localpart@domainpart/resourcepart</h3> | ||
5917 | |||
5918 | <p>If the JID contained in the 'to' attribute is of the form <localpart@domainpart/resourcepart> and the user exists but there is no connected resource that exactly matches the full JID, the stanza SHOULD be processed as if the JID were of the form <localpart@domainpart> as described under <a class='info' href='#rules-local-barejid-userexists'>Section 10.5.3.2<span> (</span><span class='info'>User Exists</span><span>)</span></a>. | ||
5919 | </p> | ||
5920 | <p>If the JID contained in the 'to' attribute is of the form <localpart@domainpart/resourcepart>, the user exists, and there is a connected resource that exactly matches the full JID, the server MUST deliver the stanza to that connected resource. | ||
5921 | </p> | ||
5922 | <a name="xml"></a><br /><hr /> | ||
5923 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5924 | <a name="rfc.section.11"></a><h3>11. | ||
5925 | XML Usage</h3> | ||
5926 | |||
5927 | <a name="xml-restrictions"></a><br /><hr /> | ||
5928 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5929 | <a name="rfc.section.11.1"></a><h3>11.1. | ||
5930 | XML Restrictions</h3> | ||
5931 | |||
5932 | <p>XMPP defines a class of data objects called XML streams as well as the behavior of computer programs that process XML streams. XMPP is an application profile or restricted form of the Extensible Markup Language <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>, and a complete XML stream (including start and end stream tags) is a conforming XML document. | ||
5933 | </p> | ||
5934 | <p>However, XMPP does not deal with XML documents but with XML streams. Because XMPP does not require the parsing of arbitrary and complete XML documents, there is no requirement that XMPP needs to support the full feature set of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>. Furthermore, XMPP uses XML to define protocol data structures and extensions for the purpose of structured interactions between network entities and therefore adheres to the recommendations provided in <a class='info' href='#XML-GUIDE'>[XML‑GUIDE]<span> (</span><span class='info'>Hollenbeck, S., Rose, M., and L. Masinter, “Guidelines for the Use of Extensible Markup Language (XML) within IETF Protocols,” January 2003.</span><span>)</span></a> regarding restrictions on the use of XML in IETF protocols. As a result, the following features of XML are prohibited in XMPP: | ||
5935 | </p> | ||
5936 | <p> | ||
5937 | </p> | ||
5938 | <ul class="text"> | ||
5939 | <li>comments (as defined in Section 2.5 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) | ||
5940 | </li> | ||
5941 | <li>processing instructions (Section 2.6 therein) | ||
5942 | </li> | ||
5943 | <li>internal or external DTD subsets (Section 2.8 therein) | ||
5944 | </li> | ||
5945 | <li>internal or external entity references (Section 4.2 therein) with the exception of the predefined entities (Section 4.6 therein) | ||
5946 | </li> | ||
5947 | </ul><p> | ||
5948 | |||
5949 | </p> | ||
5950 | <p>An XMPP implementation MUST behave as follows with regard to these features: | ||
5951 | </p> | ||
5952 | <p> | ||
5953 | </p> | ||
5954 | <ol class="text"> | ||
5955 | <li>An XMPP implementation MUST NOT inject characters matching such features into an XML stream. | ||
5956 | </li> | ||
5957 | <li>If an XMPP implementation receives characters matching such features over an XML stream, it MUST close the stream with a stream error, which SHOULD be <restricted-xml/> (<a class='info' href='#streams-error-conditions-restricted-xml'>Section 4.9.3.18<span> (</span><span class='info'>restricted-xml</span><span>)</span></a>), although some existing implementations send <bad-format/> (<a class='info' href='#streams-error-conditions-bad-format'>Section 4.9.3.1<span> (</span><span class='info'>bad-format</span><span>)</span></a>) instead. | ||
5958 | </li> | ||
5959 | </ol><p> | ||
5960 | |||
5961 | </p> | ||
5962 | <a name="xml-ns"></a><br /><hr /> | ||
5963 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5964 | <a name="rfc.section.11.2"></a><h3>11.2. | ||
5965 | XML Namespace Names and Prefixes</h3> | ||
5966 | |||
5967 | <p>XML namespaces (see <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>) are used within XMPP streams to create strict boundaries of data ownership. The basic function of namespaces is to separate different vocabularies of XML elements that are structurally mixed together. Ensuring that XMPP streams are namespace-aware enables any allowable XML to be structurally mixed with any data element within XMPP. XMPP-specific rules for XML namespace names and prefixes are defined under <a class='info' href='#streams-ns'>Section 4.8<span> (</span><span class='info'>XML Namespaces</span><span>)</span></a> for XML streams and <a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a> for XML stanzas. | ||
5968 | </p> | ||
5969 | <a name="xml-wellformed"></a><br /><hr /> | ||
5970 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
5971 | <a name="rfc.section.11.3"></a><h3>11.3. | ||
5972 | Well-Formedness</h3> | ||
5973 | |||
5974 | <p>In XML, there are two varieties of well-formedness: | ||
5975 | </p> | ||
5976 | <p> | ||
5977 | </p> | ||
5978 | <ul class="text"> | ||
5979 | <li>"XML-well-formedness" in accordance with the definition of "well-formed" from Section 2.1 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>. | ||
5980 | </li> | ||
5981 | <li>"Namespace-well-formedness" in accordance with the definition of "namespace-well-formed" from Section 7 of <a class='info' href='#XML-NAMES'>[XML‑NAMES]<span> (</span><span class='info'>Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “Namespaces in XML 1.0 (Third Edition),” December 2009.</span><span>)</span></a>. | ||
5982 | </li> | ||
5983 | </ul><p> | ||
5984 | |||
5985 | </p> | ||
5986 | <p>The following rules apply: | ||
5987 | </p> | ||
5988 | <p> | ||
5989 | </p> | ||
5990 | <ol class="text"> | ||
5991 | <li>An XMPP entity MUST NOT generate data that is not XML-well-formed. | ||
5992 | </li> | ||
5993 | <li>An XMPP entity MUST NOT accept data that is not XML-well-formed; instead it MUST close the stream over which the data was received with a <not-well-formed/> stream error (<a class='info' href='#streams-error-conditions-not-well-formed'>Section 4.9.3.13<span> (</span><span class='info'>not-well-formed</span><span>)</span></a>). | ||
5994 | </li> | ||
5995 | <li>An XMPP entity MUST NOT generate data that is not namespace-well-formed. | ||
5996 | </li> | ||
5997 | <li>An XMPP entity MUST NOT accept data that is not namespace-well-formed (in particular, an XMPP server MUST NOT route or deliver data that is not namespace-well-formed); instead it MUST return either a <not-acceptable/> stanza error (<a class='info' href='#stanzas-error-conditions-not-acceptable'>Section 8.3.3.9<span> (</span><span class='info'>not-acceptable</span><span>)</span></a>) or close the stream with a <not-well-formed/> stream error (<a class='info' href='#streams-error-conditions-not-well-formed'>Section 4.9.3.13<span> (</span><span class='info'>not-well-formed</span><span>)</span></a>), where it is preferable to close the stream with a stream error because accepting such data can open an entity to certain denial-of-service attacks. | ||
5998 | </li> | ||
5999 | </ol><p> | ||
6000 | |||
6001 | </p> | ||
6002 | <p></p> | ||
6003 | <blockquote class="text"> | ||
6004 | <p>Interoperability Note: Because these restrictions were underspecified in <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a>, it is possible that implementations based on that specification will send data that does not comply with these restrictions. | ||
6005 | </p> | ||
6006 | </blockquote> | ||
6007 | |||
6008 | <a name="xml-validation"></a><br /><hr /> | ||
6009 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6010 | <a name="rfc.section.11.4"></a><h3>11.4. | ||
6011 | Validation</h3> | ||
6012 | |||
6013 | <p>A server is not responsible for ensuring that XML data delivered to a connected client or routed to a peer server is valid, in accordance with the definition of "valid" provided in Section 2.8 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>. An implementation MAY choose to accept or send only data that has been explicitly validated against the schemas provided in this document, but such behavior is OPTIONAL. Clients are advised not to rely on the ability to send data that does not conform to the schemas, and SHOULD ignore any non-conformant elements or attributes on the incoming XML stream. | ||
6014 | </p> | ||
6015 | <p></p> | ||
6016 | <blockquote class="text"> | ||
6017 | <p>Informational Note: The terms "valid" and "well-formed" are distinct in XML. | ||
6018 | </p> | ||
6019 | </blockquote> | ||
6020 | |||
6021 | <a name="xml-declaration"></a><br /><hr /> | ||
6022 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6023 | <a name="rfc.section.11.5"></a><h3>11.5. | ||
6024 | Inclusion of XML Declaration</h3> | ||
6025 | |||
6026 | <p>Before sending a stream header, an implementation SHOULD send an XML declaration (matching the "XMLDecl" production from <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>). Applications MUST follow the rules provided in <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a> regarding the format of the XML declaration and the circumstances under which the XML declaration is included. | ||
6027 | </p> | ||
6028 | <p>Because external markup declarations are prohibited in XMPP (as described under <a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a>), the standalone document declaration (matching the "SDDecl" production from <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>) would have no meaning and therefore MUST NOT be included in an XML declaration sent over an XML stream. If an XMPP entity receives an XML declaration containing a standalone document declaration set to a value of "no", the entity MUST either ignore the standalone document declaration or close the stream with a stream error, which SHOULD be <restricted-xml/> (<a class='info' href='#streams-error-conditions-restricted-xml'>Section 4.9.3.18<span> (</span><span class='info'>restricted-xml</span><span>)</span></a>). | ||
6029 | </p> | ||
6030 | <a name="xml-encoding"></a><br /><hr /> | ||
6031 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6032 | <a name="rfc.section.11.6"></a><h3>11.6. | ||
6033 | Character Encoding</h3> | ||
6034 | |||
6035 | <p>Implementations MUST support the UTF-8 transformation of Universal Character Set <a class='info' href='#UCS2'>[UCS2]<span> (</span><span class='info'>International Organization for Standardization, “Information Technology - Universal Multiple-octet coded Character Set (UCS) - Amendment 2: UCS Transformation Format 8 (UTF-8),” October 1996.</span><span>)</span></a> characters, as needed for conformance with <a class='info' href='#CHARSETS'>[CHARSETS]<span> (</span><span class='info'>Alvestrand, H., “IETF Policy on Character Sets and Languages,” January 1998.</span><span>)</span></a> and as defined in <a class='info' href='#UTF-8'>[UTF‑8]<span> (</span><span class='info'>Yergeau, F., “UTF-8, a transformation format of ISO 10646,” November 2003.</span><span>)</span></a>. Implementations MUST NOT attempt to use any other encoding. If one party to an XML stream detects that the other party has attempted to send XML data with an encoding other than UTF-8, it MUST close the stream with a stream error, which SHOULD be <unsupported-encoding/> (<a class='info' href='#streams-error-conditions-unsupported-encoding'>Section 4.9.3.22<span> (</span><span class='info'>unsupported-encoding</span><span>)</span></a>), although some existing implementations send <bad-format/> (<a class='info' href='#streams-error-conditions-bad-format'>Section 4.9.3.1<span> (</span><span class='info'>bad-format</span><span>)</span></a>) instead. | ||
6036 | </p> | ||
6037 | <p>Because it is mandatory for an XMPP implementation to support all and only the UTF-8 encoding and because UTF-8 always has the same byte order, an implementation MUST NOT send a byte order mark ("BOM") at the beginning of the data stream. If an entity receives the <a class='info' href='#UNICODE'>[UNICODE]<span> (</span><span class='info'>The Unicode Consortium, “The Unicode Standard, Version 6.0,” 2010.</span><span>)</span></a> character U+FEFF anywhere in an XML stream (including as the first character of the stream), it MUST interpret that character as a zero width no-break space, not as a byte order mark. | ||
6038 | </p> | ||
6039 | <a name="xml-whitespace"></a><br /><hr /> | ||
6040 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6041 | <a name="rfc.section.11.7"></a><h3>11.7. | ||
6042 | Whitespace</h3> | ||
6043 | |||
6044 | <p>Except where explicitly disallowed (e.g., during <a class='info' href='#tls'>TLS negotiation<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> and <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>), either entity MAY send whitespace as separators between XML stanzas or between any other first-level elements sent over the stream. One common use for sending such whitespace is explained under <a class='info' href='#streams-close'>Section 4.4<span> (</span><span class='info'>Closing a Stream</span><span>)</span></a>. | ||
6045 | </p> | ||
6046 | <a name="xml-versions"></a><br /><hr /> | ||
6047 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6048 | <a name="rfc.section.11.8"></a><h3>11.8. | ||
6049 | XML Versions</h3> | ||
6050 | |||
6051 | <p>XMPP is an application profile of XML 1.0. A future version of XMPP might be defined in terms of higher versions of XML, but this specification defines XMPP only in terms of XML 1.0. | ||
6052 | </p> | ||
6053 | <a name="i18n"></a><br /><hr /> | ||
6054 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6055 | <a name="rfc.section.12"></a><h3>12. | ||
6056 | Internationalization Considerations</h3> | ||
6057 | |||
6058 | <p>As specified under <a class='info' href='#xml-encoding'>Section 11.6<span> (</span><span class='info'>Character Encoding</span><span>)</span></a>, XML streams MUST be encoded in UTF-8. | ||
6059 | </p> | ||
6060 | <p>As specified under <a class='info' href='#streams-attr'>Section 4.7<span> (</span><span class='info'>Stream Attributes</span><span>)</span></a>, an XML stream SHOULD include an 'xml:lang' attribute specifying the default language for any XML character data that is intended to be presented to a human user. As specified under <a class='info' href='#stanzas-attributes-lang'>Section 8.1.5<span> (</span><span class='info'>xml:lang</span><span>)</span></a>, an XML stanza SHOULD include an 'xml:lang' attribute if the stanza contains XML character data that is intended to be presented to a human user. A server SHOULD apply the default 'xml:lang' attribute to stanzas it routes or delivers on behalf of connected entities, and MUST NOT modify or delete 'xml:lang' attributes on stanzas it receives from other entities. | ||
6061 | </p> | ||
6062 | <p>Internationalization of XMPP addresses is specified in <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>. | ||
6063 | </p> | ||
6064 | <a name="security"></a><br /><hr /> | ||
6065 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6066 | <a name="rfc.section.13"></a><h3>13. | ||
6067 | Security Considerations</h3> | ||
6068 | |||
6069 | <a name="security-fundamentals"></a><br /><hr /> | ||
6070 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6071 | <a name="rfc.section.13.1"></a><h3>13.1. | ||
6072 | Fundamentals</h3> | ||
6073 | |||
6074 | <p>XMPP technologies are typically deployed using a decentralized client-server architecture. As a result, several paths are possible when two XMPP entities need to communicate: | ||
6075 | </p> | ||
6076 | <p> | ||
6077 | </p> | ||
6078 | <ol class="text"> | ||
6079 | <li>Both entities are servers. In this case, the entities can establish a direct server-to-server stream between themselves. | ||
6080 | </li> | ||
6081 | <li>One entity is a server and the other entity is a client whose account is hosted on that server. In this case, the entities can establish a direct client-to-server stream between themselves. | ||
6082 | </li> | ||
6083 | <li>Both entities are clients whose accounts are hosted on the same server. In this case, the entities cannot establish a direct stream between themselves, but there is only one intermediate entity between them, whose policies they might understand and in which they might have some level of trust (e.g., the server might require the use of Transport Layer Security for all client connections). | ||
6084 | </li> | ||
6085 | <li>Both entities are clients but their accounts are hosted on different servers. In this case, the entities cannot establish a direct stream between themselves and there are two intermediate entities between them; each client might have some trust in the server that hosts its account but might know nothing about the policies of the server to which the other client connects. | ||
6086 | </li> | ||
6087 | </ol><p> | ||
6088 | |||
6089 | </p> | ||
6090 | <p>This specification covers only the security of a direct XML stream between two servers or between a client and a server (cases #1 and #2), where each stream can be considered a single "hop" along a communication path. The goal of security for a multi-hop path (cases #3 and #4), although very desirable, is out of scope for this specification. | ||
6091 | </p> | ||
6092 | <p>In accordance with <a class='info' href='#SEC-GUIDE'>[SEC‑GUIDE]<span> (</span><span class='info'>Rescorla, E. and B. Korver, “Guidelines for Writing RFC Text on Security Considerations,” July 2003.</span><span>)</span></a>, this specification covers communication security (confidentiality, data integrity, and peer entity authentication), non-repudiation, and systems security (unauthorized usage, inappropriate usage, and denial of service). We also discuss common security issues such as information leaks, firewalls, and directory harvesting, as well as best practices related to the reuse of technologies such as base 64, DNS, cryptographic hash functions, SASL, TLS, UTF-8, and XML. | ||
6093 | </p> | ||
6094 | <a name="security-threats"></a><br /><hr /> | ||
6095 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6096 | <a name="rfc.section.13.2"></a><h3>13.2. | ||
6097 | Threat Model</h3> | ||
6098 | |||
6099 | <p>The threat model for XMPP is in essence the standard "Internet Threat Model" described in <a class='info' href='#SEC-GUIDE'>[SEC‑GUIDE]<span> (</span><span class='info'>Rescorla, E. and B. Korver, “Guidelines for Writing RFC Text on Security Considerations,” July 2003.</span><span>)</span></a>. Attackers are assumed to be interested in and capable of launching the following attacks against unprotected XMPP systems: | ||
6100 | </p> | ||
6101 | <p> | ||
6102 | </p> | ||
6103 | <ul class="text"> | ||
6104 | <li>Eavesdropping | ||
6105 | </li> | ||
6106 | <li>Sniffing passwords | ||
6107 | </li> | ||
6108 | <li>Breaking passwords through dictionary attacks | ||
6109 | </li> | ||
6110 | <li>Discovering usernames through directory harvesting attacks | ||
6111 | </li> | ||
6112 | <li>Replaying, inserting, deleting, or modifying stanzas | ||
6113 | </li> | ||
6114 | <li>Spoofing users | ||
6115 | </li> | ||
6116 | <li>Gaining unauthorized entry to a server or account | ||
6117 | </li> | ||
6118 | <li>Using a server or account inappropriately | ||
6119 | </li> | ||
6120 | <li>Denying service to other entities | ||
6121 | </li> | ||
6122 | <li>Subverting communication streams through man-in-the-middle attacks | ||
6123 | </li> | ||
6124 | <li>Gaining control over on-path servers | ||
6125 | </li> | ||
6126 | </ul><p> | ||
6127 | |||
6128 | </p> | ||
6129 | <p>Where appropriate, the following sections describe methods for protecting against these threats. | ||
6130 | </p> | ||
6131 | <a name="security-layers"></a><br /><hr /> | ||
6132 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6133 | <a name="rfc.section.13.3"></a><h3>13.3. | ||
6134 | Order of Layers</h3> | ||
6135 | |||
6136 | <p>The order of layers in which protocols MUST be stacked is as follows: | ||
6137 | </p> | ||
6138 | <p> | ||
6139 | </p> | ||
6140 | <ol class="text"> | ||
6141 | <li>TCP | ||
6142 | </li> | ||
6143 | <li>TLS | ||
6144 | </li> | ||
6145 | <li>SASL | ||
6146 | </li> | ||
6147 | <li>XMPP | ||
6148 | </li> | ||
6149 | </ol><p> | ||
6150 | |||
6151 | </p> | ||
6152 | <p>This order has important security implications, as described throughout these security considerations. | ||
6153 | </p> | ||
6154 | <p>Within XMPP, XML stanzas are further ordered on top of XML streams, as described under <a class='info' href='#streams'>Section 4<span> (</span><span class='info'>XML Streams</span><span>)</span></a>. | ||
6155 | </p> | ||
6156 | <a name="security-confidentiality"></a><br /><hr /> | ||
6157 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6158 | <a name="rfc.section.13.4"></a><h3>13.4. | ||
6159 | Confidentiality and Integrity</h3> | ||
6160 | |||
6161 | <p>The use of Transport Layer Security (TLS) with appropriate ciphersuites provides a reliable mechanism to ensure the confidentiality and integrity of data exchanged between a client and a server or between two servers. Therefore, TLS can help to protect against eavesdropping, password sniffing, man-in-the-middle attacks, and stanza replays, insertion, deletion, and modification over an XML stream. XMPP clients and servers MUST support TLS as defined under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>. | ||
6162 | </p> | ||
6163 | <p></p> | ||
6164 | <blockquote class="text"> | ||
6165 | <p>Informational Note: The confidentiality and integrity of a stream can be protected by methods other than TLS, e.g., by means of a SASL mechanism that involves negotiation of a security layer. | ||
6166 | </p> | ||
6167 | </blockquote> | ||
6168 | |||
6169 | <p></p> | ||
6170 | <blockquote class="text"> | ||
6171 | <p>Security Warning: The use of TLS in XMPP applies to a single stream. Because XMPP is typically deployed using a distributed client-server architecture (as explained under <a class='info' href='#arch-network'>Section 2.5<span> (</span><span class='info'>Distributed Network of Clients and Servers</span><span>)</span></a>), a stanza might traverse multiple streams, and not all of those streams might be TLS-protected. For example, a stanza sent from a client with a session at one server (e.g., <romeo@example.net/orchard>) and intended for delivery to a client with a session at another server (e.g., <juliet@example.com/balcony>) will traverse three streams: (1) the stream from the sender's client to its server, (2) the stream from the sender's server to the recipient's server, and (3) the stream from the recipient's server to the recipient's client. Furthermore, the stanza will be processed as cleartext within the sender's server and the recipient's server. Therefore, even if the stream from the sender's client to its server is protected, the confidentiality and integrity of a stanza sent over that protected stream cannot be guaranteed when the stanza is processed by the sender's server, sent from the sender's server to the recipient's server, processed by the recipient's server, or sent from the recipient's server to the recipient's client. Only a robust technology for end-to-end encryption could ensure the confidentiality and integrity of a stanza as it traverses all of the "hops" along a communication path (e.g., a technology that meets the requirements defined in <a class='info' href='#E2E-REQS'>[E2E‑REQS]<span> (</span><span class='info'>Saint-Andre, P., “Requirements for End-to-End Encryption in the Extensible Messaging and Presence Protocol (XMPP),” March 2010.</span><span>)</span></a>). Unfortunately, the XMPP community has so far failed to produce an end-to-end encryption technology that might be suitable for widespread implementation and deployment, and definition of such a technology is out of scope for this document. | ||
6172 | </p> | ||
6173 | </blockquote> | ||
6174 | |||
6175 | <a name="security-authentication"></a><br /><hr /> | ||
6176 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6177 | <a name="rfc.section.13.5"></a><h3>13.5. | ||
6178 | Peer Entity Authentication</h3> | ||
6179 | |||
6180 | <p>The use of the Simple Authentication and Security Layer (SASL) for authentication provides a reliable mechanism for peer entity authentication. Therefore, SASL helps to protect against user spoofing, unauthorized usage, and man-in-the middle attacks. XMPP clients and servers MUST support SASL as defined under <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>. | ||
6181 | </p> | ||
6182 | <a name="security-strong"></a><br /><hr /> | ||
6183 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6184 | <a name="rfc.section.13.6"></a><h3>13.6. | ||
6185 | Strong Security</h3> | ||
6186 | |||
6187 | <p><a class='info' href='#STRONGSEC'>[STRONGSEC]<span> (</span><span class='info'>Schiller, J., “Strong Security Requirements for Internet Engineering Task Force Standard Protocols,” August 2002.</span><span>)</span></a> defines "strong security" and its importance to communication over the Internet. For the purpose of XMPP communication over client-to-server and server-to-server streams, the term "strong security" refers to the use of security technologies that provide both mutual authentication and integrity checking (e.g., a combination of TLS encryption and SASL authentication using appropriate SASL mechanisms). | ||
6188 | </p> | ||
6189 | <p>Implementations MUST support strong security. Service provisioning SHOULD use strong security. | ||
6190 | </p> | ||
6191 | <p>An implementation SHOULD make it possible for an end user or service administrator to provision a deployment with specific trust anchors for the certificate presented by a connecting entity (either client or server); when an application is thus provisioned, it MUST NOT use a generic PKI trust store to authenticate the connecting entity. More detailed rules and guidelines regarding certificate validation are provided in the next section. | ||
6192 | </p> | ||
6193 | <p>The initial stream and the response stream MUST be secured separately, although security in both directions MAY be established via mechanisms that provide mutual authentication. | ||
6194 | </p> | ||
6195 | <a name="security-certificates"></a><br /><hr /> | ||
6196 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6197 | <a name="rfc.section.13.7"></a><h3>13.7. | ||
6198 | Certificates</h3> | ||
6199 | |||
6200 | <p>Channel encryption of an XML stream using Transport Layer Security as described under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a>, and in some cases also authentication as described under <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>, is commonly based on a PKIX certificate presented by the receiving entity (or, in the case of mutual certificate authentication, both the receiving entity and the initiating entity). This section describes best practices regarding the generation of PKIX certificates to be presented by XMPP entities and the verification of PKIX certificates presented by XMPP entities. | ||
6201 | </p> | ||
6202 | <p>In general, the following sections rely on and extend the rules and guidelines provided in the <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> profile of <a class='info' href='#X509'>[X509]<span> (</span><span class='info'>International Telecommunications Union, “Information technology - Open Systems Interconnection - The Directory: Public-key and attribute certificate frameworks,” March 2000.</span><span>)</span></a>, and in <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a>. The reader is referred to those specifications for a detailed understanding of PKIX certificates and their use in TLS. | ||
6203 | </p> | ||
6204 | <a name="security-certificates-generation"></a><br /><hr /> | ||
6205 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6206 | <a name="rfc.section.13.7.1"></a><h3>13.7.1. | ||
6207 | Certificate Generation</h3> | ||
6208 | |||
6209 | <a name="security-certificates-generation-general"></a><br /><hr /> | ||
6210 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6211 | <a name="rfc.section.13.7.1.1"></a><h3>13.7.1.1. | ||
6212 | General Considerations</h3> | ||
6213 | |||
6214 | <p>The following rules apply to end entity public key certificates that are issued to XMPP servers or clients: | ||
6215 | </p> | ||
6216 | <p> | ||
6217 | </p> | ||
6218 | <ol class="text"> | ||
6219 | <li>The certificate MUST conform to <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>. | ||
6220 | </li> | ||
6221 | <li>The certificate MUST NOT contain a basicConstraints extension with the cA boolean set to TRUE. | ||
6222 | </li> | ||
6223 | <li>The subject field MUST NOT be null. | ||
6224 | </li> | ||
6225 | <li>The signatureAlgorithm SHOULD be the PKCS #1 version 1.5 signature algorithm with SHA-256 as defined by <a class='info' href='#PKIX-ALGO'>[PKIX‑ALGO]<span> (</span><span class='info'>Jonsson, J. and B. Kaliski, “Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1,” February 2003.</span><span>)</span></a>, or a stronger algorithm if available. | ||
6226 | </li> | ||
6227 | <li>The certificate SHOULD include an Authority Information Access (AIA) extension that specifies the address of an Online Certificate Status Protocol <a class='info' href='#OCSP'>[OCSP]<span> (</span><span class='info'>Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, “X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP,” June 1999.</span><span>)</span></a> responder (if not, a relying party would need to fall back on the use of Certificate Revocation Lists (CRLs) as described in <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>). | ||
6228 | </li> | ||
6229 | </ol><p> | ||
6230 | |||
6231 | </p> | ||
6232 | <p>The following rules apply to certification authority (CA) certificates that are used by issuers of XMPP end entity certificates: | ||
6233 | </p> | ||
6234 | <p> | ||
6235 | </p> | ||
6236 | <ol class="text"> | ||
6237 | <li>The certificate MUST conform to <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>. | ||
6238 | </li> | ||
6239 | <li>The certificate MUST contain a keyUsage extension with the digitalSignature bit set. | ||
6240 | </li> | ||
6241 | <li>The subject field MUST NOT be null. | ||
6242 | </li> | ||
6243 | <li>The signatureAlgorithm SHOULD be the PKCS #1 version 1.5 | ||
6244 | signature algorithm with SHA-256 as defined by <a class='info' href='#PKIX-ALGO'>[PKIX‑ALGO]<span> (</span><span class='info'>Jonsson, J. and B. Kaliski, “Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1,” February 2003.</span><span>)</span></a>, or a | ||
6245 | stronger algorithm if available. | ||
6246 | </li> | ||
6247 | <li>For issuers of public key certificates, the issuer's certificate MUST contain a basicConstraints extension with the cA boolean set to TRUE. | ||
6248 | </li> | ||
6249 | </ol><p> | ||
6250 | |||
6251 | </p> | ||
6252 | <a name="security-certificates-generation-server"></a><br /><hr /> | ||
6253 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6254 | <a name="rfc.section.13.7.1.2"></a><h3>13.7.1.2. | ||
6255 | Server Certificates</h3> | ||
6256 | |||
6257 | <a name="security-certificates-generation-server-rules"></a><br /><hr /> | ||
6258 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6259 | <a name="rfc.section.13.7.1.2.1"></a><h3>13.7.1.2.1. | ||
6260 | Rules</h3> | ||
6261 | |||
6262 | <p>In a PKIX certificate to be presented by an XMPP server (i.e., a "server certificate"), the certificate SHOULD include one or more XMPP addresses (i.e., domainparts) associated with XMPP services hosted at the server. The rules and guidelines defined in <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> apply to XMPP server certificates, with the following XMPP-specific considerations: | ||
6263 | </p> | ||
6264 | <p> | ||
6265 | </p> | ||
6266 | <ul class="text"> | ||
6267 | <li>Support for the DNS-ID identifier type <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> is REQUIRED in XMPP client and server software implementations. Certification authorities that issue XMPP-specific certificates MUST support the DNS-ID identifier type. XMPP service providers SHOULD include the DNS-ID identifier type in certificate requests. | ||
6268 | </li> | ||
6269 | <li>Support for the SRV-ID identifier type <a class='info' href='#PKIX-SRV'>[PKIX‑SRV]<span> (</span><span class='info'>Santesson, S., “Internet X.509 Public Key Infrastructure Subject Alternative Name for Expression of Service Name,” August 2007.</span><span>)</span></a> is REQUIRED for XMPP client and server software implementations (for verification purposes XMPP client implementations need to support only the "_xmpp-client" service type, whereas XMPP server implementations need to support both the "_xmpp-client" and "_xmpp-server" service types). Certification authorities that issue XMPP-specific certificates SHOULD support the SRV-ID identifier type. XMPP service providers SHOULD include the SRV-ID identifier type in certificate requests. | ||
6270 | </li> | ||
6271 | <li>Support for the XmppAddr identifier type (specified under <a class='info' href='#security-certificates-generation-xmppaddr'>Section 13.7.1.4<span> (</span><span class='info'>XmppAddr Identifier Type</span><span>)</span></a>) is encouraged in XMPP client and server software implementations for the sake of backward-compatibility, but is no longer encouraged in certificates issued by certification authorities or requested by XMPP service providers. | ||
6272 | </li> | ||
6273 | <li>DNS domain names in server certificates MAY contain the wildcard character '*' as the complete left-most label within the identifier. | ||
6274 | </li> | ||
6275 | </ul><p> | ||
6276 | |||
6277 | </p> | ||
6278 | <a name="security-certificates-generation-server-examples"></a><br /><hr /> | ||
6279 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6280 | <a name="rfc.section.13.7.1.2.2"></a><h3>13.7.1.2.2. | ||
6281 | Examples</h3> | ||
6282 | |||
6283 | <p>For our first (relatively simple) example, consider a company called "Example Products, Inc." It hosts an XMPP service at "im.example.com" (i.e., user addresses at the service are of the form "user@im.example.com"), and SRV lookups for the xmpp-client and xmpp-server services at "im.example.com" yield one machine, called "x.example.com", as follows: | ||
6284 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
6285 | _xmpp-client._tcp.im.example.com. 400 IN SRV 20 0 5222 x.example.com | ||
6286 | _xmpp-server._tcp.im.example.com. 400 IN SRV 20 0 5269 x.example.com | ||
6287 | </pre></div> | ||
6288 | <p>The certificate presented by x.example.com contains the following representations: | ||
6289 | </p> | ||
6290 | <p> | ||
6291 | </p> | ||
6292 | <ul class="text"> | ||
6293 | <li>An otherName type of SRVName (id-on-dnsSRV) containing an IA5String (ASCII) string of "_xmpp-client.im.example.com" | ||
6294 | </li> | ||
6295 | <li>An otherName type of SRVName (id-on-dnsSRV) containing an IA5String (ASCII) string of "_xmpp-server.im.example.com" | ||
6296 | </li> | ||
6297 | <li>A dNSName containing an ASCII string of "im.example.com" | ||
6298 | </li> | ||
6299 | <li>An otherName type of XmppAddr (id-on-xmppAddr) containing a UTF-8 string of "im.example.com" | ||
6300 | </li> | ||
6301 | <li>A CN containing an ASCII string of "Example Products, Inc." | ||
6302 | </li> | ||
6303 | </ul><p> | ||
6304 | |||
6305 | </p> | ||
6306 | <p>For our second (more complex) example, consider an ISP called "Example Internet Services". It hosts an XMPP service at "example.net" (i.e., user addresses at the service are of the form "user@example.net"), but SRV lookups for the xmpp-client and xmpp-server services at "example.net" yield two machines ("x1.example.net" and "x2.example.net"), as follows: | ||
6307 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
6308 | _xmpp-client._tcp.example.net. 68400 IN SRV 20 0 5222 x1.example.net. | ||
6309 | _xmpp-client._tcp.example.net. 68400 IN SRV 20 0 5222 x2.example.net. | ||
6310 | _xmpp-server._tcp.example.net. 68400 IN SRV 20 0 5269 x1.example.net. | ||
6311 | _xmpp-server._tcp.example.net. 68400 IN SRV 20 0 5269 x2.example.net. | ||
6312 | </pre></div> | ||
6313 | <p>Example Internet Services also hosts chatrooms at chat.example.net, and provides an xmpp-server SRV record for that service as well (thus enabling entities from remote domains to access that service). It also might provide other such services in the future, so it wishes to represent a wildcard in its certificate to handle such growth. | ||
6314 | </p> | ||
6315 | <p>The certificate presented by either x1.example.net or x2.example.net contains the following representations: | ||
6316 | </p> | ||
6317 | <p> | ||
6318 | </p> | ||
6319 | <ul class="text"> | ||
6320 | <li>An otherName type of SRVName (id-on-dnsSRV) containing an IA5String (ASCII) string of "_xmpp-client.example.net" | ||
6321 | </li> | ||
6322 | <li>An otherName type of SRVName (id-on-dnsSRV) containing an IA5String (ASCII) string of "_xmpp-server.example.net" | ||
6323 | </li> | ||
6324 | <li>An otherName type of SRVName (id-on-dnsSRV) containing an IA5String (ASCII) string of "_xmpp-server.chat.example.net" | ||
6325 | </li> | ||
6326 | <li>A dNSName containing an ASCII string of "example.net" | ||
6327 | </li> | ||
6328 | <li>A dNSName containing an ASCII string of "*.example.net" | ||
6329 | </li> | ||
6330 | <li>An otherName type of XmppAddr (id-on-xmppAddr) containing a UTF-8 string of "example.net" | ||
6331 | </li> | ||
6332 | <li>An otherName type of XmppAddr (id-on-xmppAddr) containing a UTF-8 string of "chat.example.net" | ||
6333 | </li> | ||
6334 | <li>A CN containing an ASCII string of "Example Internet Services" | ||
6335 | </li> | ||
6336 | </ul><p> | ||
6337 | |||
6338 | </p> | ||
6339 | <a name="security-certificates-generation-client"></a><br /><hr /> | ||
6340 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6341 | <a name="rfc.section.13.7.1.3"></a><h3>13.7.1.3. | ||
6342 | Client Certificates</h3> | ||
6343 | |||
6344 | <p>In a PKIX certificate to be presented by an XMPP client controlled by a human user (i.e., a "client certificate"), it is RECOMMENDED for the certificate to include one or more JIDs associated with an XMPP user. If included, a JID MUST be represented as an XmppAddr as specified under <a class='info' href='#security-certificates-generation-xmppaddr'>Section 13.7.1.4<span> (</span><span class='info'>XmppAddr Identifier Type</span><span>)</span></a>. | ||
6345 | </p> | ||
6346 | <a name="security-certificates-generation-xmppaddr"></a><br /><hr /> | ||
6347 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6348 | <a name="rfc.section.13.7.1.4"></a><h3>13.7.1.4. | ||
6349 | XmppAddr Identifier Type</h3> | ||
6350 | |||
6351 | <p>The XmppAddr identifier type is a UTF8String within an otherName entity inside the subjectAltName, using the <a class='info' href='#ASN.1'>[ASN.1]<span> (</span><span class='info'>CCITT, “Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1),” 1988.</span><span>)</span></a> Object Identifier "id-on-xmppAddr" specified below. | ||
6352 | </p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
6353 | id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) | ||
6354 | dod(6) internet(1) security(5) mechanisms(5) pkix(7) } | ||
6355 | |||
6356 | id-on OBJECT IDENTIFIER ::= { id-pkix 8 } -- other name forms | ||
6357 | |||
6358 | id-on-xmppAddr OBJECT IDENTIFIER ::= { id-on 5 } | ||
6359 | |||
6360 | XmppAddr ::= UTF8String | ||
6361 | </pre></div> | ||
6362 | <p>As an alternative to the "id-on-xmppAddr" notation, this Object Identifier MAY be represented in dotted display format (i.e., "1.3.6.1.5.5.7.8.5") or in the Uniform Resource Name notation specified in <a class='info' href='#URN-OID'>[URN‑OID]<span> (</span><span class='info'>Mealling, M., “A URN Namespace of Object Identifiers,” February 2001.</span><span>)</span></a> (i.e., "urn:oid:1.3.6.1.5.5.7.8.5"). | ||
6363 | </p> | ||
6364 | <p>Thus for example the JID <juliet@im.example.com> as included in a certificate could be formatted in any of the following three ways: | ||
6365 | </p> | ||
6366 | <p> | ||
6367 | </p> | ||
6368 | <blockquote class="text"><dl> | ||
6369 | <dt>id-on-xmppAddr:</dt> | ||
6370 | <dd>subjectAltName=otherName:id-on-xmppAddr;UTF8:juliet@im.example.com | ||
6371 | </dd> | ||
6372 | <dt>dotted display format:</dt> | ||
6373 | <dd>subjectAltName=otherName:1.3.6.1.5.5.7.8.5;UTF8:juliet@im.example.com | ||
6374 | </dd> | ||
6375 | <dt>URN notation:</dt> | ||
6376 | <dd>subjectAltName=otherName:urn:oid:1.3.6.1.5.5.7.8.5;UTF8:juliet@im.example.com | ||
6377 | </dd> | ||
6378 | </dl></blockquote><p> | ||
6379 | |||
6380 | </p> | ||
6381 | <p>Use of the "id-on-xmppAddr" format is RECOMMENDED in the generation of certificates, but all three formats MUST be supported for the purpose of certificate validation. | ||
6382 | </p> | ||
6383 | <p>The "id-on-xmppAddr" object identifier MAY be used in conjunction with the extended key usage extension specified in Section 4.2.1.12 of <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> in order to explicitly define and limit the intended use of a certificate to the XMPP network. | ||
6384 | </p> | ||
6385 | <a name="security-certificates-validation"></a><br /><hr /> | ||
6386 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6387 | <a name="rfc.section.13.7.2"></a><h3>13.7.2. | ||
6388 | Certificate Validation</h3> | ||
6389 | |||
6390 | <p>When an XMPP entity is presented with a server certificate or client certificate by a peer for the purpose of encryption or authentication of XML streams as described under <a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> and <a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>, the entity MUST attempt to validate the certificate to determine if the certificate will be considered a "trusted certificate", i.e., a certificate that is acceptable for encryption and/or authentication in accordance with the XMPP entity's local service policies or configured settings. | ||
6391 | </p> | ||
6392 | <p>For both server certificates and client certificates, the validating entity MUST do the following: | ||
6393 | </p> | ||
6394 | <p> | ||
6395 | </p> | ||
6396 | <ol class="text"> | ||
6397 | <li>Attempt to verify the integrity of the certificate. | ||
6398 | </li> | ||
6399 | <li>Attempt to verify that the certificate has been properly signed by the issuing Certificate Authority. | ||
6400 | </li> | ||
6401 | <li>Attempt to validate the full certification path. | ||
6402 | </li> | ||
6403 | <li>Check the rules for end entity public key certificates and certification authority certificates specified under <a class='info' href='#security-certificates-generation-general'>Section 13.7.1.1<span> (</span><span class='info'>General Considerations</span><span>)</span></a> for the general case and under either <a class='info' href='#security-certificates-generation-server'>Section 13.7.1.2<span> (</span><span class='info'>Server Certificates</span><span>)</span></a> or <a class='info' href='#security-certificates-generation-client'>Section 13.7.1.3<span> (</span><span class='info'>Client Certificates</span><span>)</span></a> for XMPP server or client certificates, respectively. | ||
6404 | </li> | ||
6405 | <li>Check certificate revocation messages via Certificate Revocation Lists (CRLs), the Online Certificate Status Protocol <a class='info' href='#OCSP'>[OCSP]<span> (</span><span class='info'>Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, “X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP,” June 1999.</span><span>)</span></a>, or both. | ||
6406 | </li> | ||
6407 | </ol><p> | ||
6408 | |||
6409 | </p> | ||
6410 | <p>If any of those validation attempts fail, the validating entity MUST unilaterally terminate the session. | ||
6411 | </p> | ||
6412 | <p>The following sections describe the additional identity verification rules that apply to server-to-server and client-to-server streams. | ||
6413 | </p> | ||
6414 | <p>Once the identity of the stream peer has been validated, the validating entity SHOULD also correlate the validated identity with the 'from' address (if any) of the stream header it received from the peer. If the two identities do not match, the validating entity SHOULD terminate the connection attempt (however, there might be good reasons why the identities do not match, as described under <a class='info' href='#streams-attr-from'>Section 4.7.1<span> (</span><span class='info'>from</span><span>)</span></a>). | ||
6415 | </p> | ||
6416 | <a name="security-certificates-validation-server"></a><br /><hr /> | ||
6417 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6418 | <a name="rfc.section.13.7.2.1"></a><h3>13.7.2.1. | ||
6419 | Server Certificates</h3> | ||
6420 | |||
6421 | <p>For server certificates, the rules and guidelines defined in <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> apply, with the proviso that the XmppAddr identifier specified under <a class='info' href='#security-certificates-generation-xmppaddr'>Section 13.7.1.4<span> (</span><span class='info'>XmppAddr Identifier Type</span><span>)</span></a> is allowed as a reference identifier. | ||
6422 | </p> | ||
6423 | <p>The identities to be checked are set as follows: | ||
6424 | </p> | ||
6425 | <p> | ||
6426 | </p> | ||
6427 | <ul class="text"> | ||
6428 | <li>The initiating entity sets the source domain of its reference | ||
6429 | identifiers to the 'to' address it communicates in the initial stream | ||
6430 | header; i.e., this is the identity it expects the receiving entity to | ||
6431 | provide in a PKIX certificate. | ||
6432 | </li> | ||
6433 | <li>The receiving entity sets the source domain of its reference | ||
6434 | identifiers to the 'from' address communicated by the initiating | ||
6435 | entity in the initial stream header; i.e., this is the identity that | ||
6436 | the initiating entity is trying to assert. | ||
6437 | </li> | ||
6438 | </ul><p> | ||
6439 | |||
6440 | </p> | ||
6441 | <p> | ||
6442 | In the case of server-to-server communication, the matching procedure | ||
6443 | described in <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> can be performed by an application server | ||
6444 | (receiving entity) when verifying an incoming server-to-server | ||
6445 | connection from a peer server (initiating entity). In this case, the | ||
6446 | receiving entity verifies the identity of the initiating entity and | ||
6447 | uses as the source domain of its reference identifiers the DNS domain | ||
6448 | name asserted by the initiating entity in the 'from' attribute of the | ||
6449 | initial stream header. However, the matching procedure described in | ||
6450 | <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a> remains unchanged and is applied in the same way. | ||
6451 | |||
6452 | </p> | ||
6453 | <a name="security-certificates-validation-client"></a><br /><hr /> | ||
6454 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6455 | <a name="rfc.section.13.7.2.2"></a><h3>13.7.2.2. | ||
6456 | Client Certificates</h3> | ||
6457 | |||
6458 | <p>When an XMPP server validates a certificate presented by a client, there are three possible cases, as discussed in the following sections. | ||
6459 | </p> | ||
6460 | <p>The identities to be checked are set as follows: | ||
6461 | </p> | ||
6462 | <p> | ||
6463 | </p> | ||
6464 | <ul class="text"> | ||
6465 | <li> | ||
6466 | The client sets the source domain of its reference identifiers to | ||
6467 | the 'to' address it communicates in the initial stream header; | ||
6468 | i.e., this is the identity it expects the server to provide in a | ||
6469 | PKIX certificate. | ||
6470 | |||
6471 | </li> | ||
6472 | <li> | ||
6473 | The server sets the bare JID of its reference identifiers to the | ||
6474 | 'from' address communicated by the initiating entity in the | ||
6475 | initial stream header; i.e., this is the identity that the client | ||
6476 | is trying to assert. | ||
6477 | |||
6478 | </li> | ||
6479 | </ul><p> | ||
6480 | |||
6481 | </p> | ||
6482 | <a name="security-certificates-validation-client-case1"></a><br /><hr /> | ||
6483 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6484 | <a name="rfc.section.13.7.2.2.1"></a><h3>13.7.2.2.1. | ||
6485 | Case #1</h3> | ||
6486 | |||
6487 | <p>If the client certificate appears to be certified by a certification path terminating in a trust anchor (as described in Section 6.1 of <a class='info' href='#PKIX'>[PKIX]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>), the server MUST check the certificate for any instances of the XmppAddr as described under <a class='info' href='#security-certificates-generation-xmppaddr'>Section 13.7.1.4<span> (</span><span class='info'>XmppAddr Identifier Type</span><span>)</span></a>. There are three possible sub-cases: | ||
6488 | </p> | ||
6489 | <p> | ||
6490 | </p> | ||
6491 | <blockquote class="text"><dl> | ||
6492 | <dt>Sub-Case #1:</dt> | ||
6493 | <dd>The server finds one XmppAddr for which the domainpart of the represented JID matches one of the configured FQDNs of the server; the server SHOULD use this represented JID as the validated identity of the client. | ||
6494 | </dd> | ||
6495 | <dt>Sub-Case #2:</dt> | ||
6496 | <dd>The server finds more than one XmppAddr for which the domainpart of the represented JID matches one of the configured FQDNs of the server; the server SHOULD use one of these represented JIDs as the validated identity of the client, choosing among them based on the bare JID contained in the 'from' address of the initial stream header (if any), based on the domainpart contained in the 'to' address of the initial stream header, or in accordance with local service policies (such as a lookup in a user database based on other information contained in the client certificate). | ||
6497 | </dd> | ||
6498 | <dt>Sub-Case #3:</dt> | ||
6499 | <dd>The server finds no XmppAddrs, or finds at least one XmppAddr but the domainpart of the represented JID does not match one of the configured FQDNs of the server; the server MUST NOT use the represented JID (if any) as the validated identity of the client but instead MUST validate the identity of the client using other means in accordance with local service policies (such as a lookup in a user database based on other information contained in the client certificate). If the identity cannot be so validated, the server MAY abort the validation process and terminate the TLS negotiation. | ||
6500 | </dd> | ||
6501 | </dl></blockquote><p> | ||
6502 | |||
6503 | </p> | ||
6504 | <a name="security-certificates-validation-client-case2"></a><br /><hr /> | ||
6505 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6506 | <a name="rfc.section.13.7.2.2.2"></a><h3>13.7.2.2.2. | ||
6507 | Case #2</h3> | ||
6508 | |||
6509 | <p>If the client certificate is certified by a Certificate Authority not known to the server, the server MUST proceed as under Case #1, Sub-Case #3. | ||
6510 | </p> | ||
6511 | <a name="security-certificates-validation-client-case3"></a><br /><hr /> | ||
6512 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6513 | <a name="rfc.section.13.7.2.2.3"></a><h3>13.7.2.2.3. | ||
6514 | Case #3</h3> | ||
6515 | |||
6516 | <p>If the client certificate is self-signed, the server MUST proceed as under Case #1, Sub-Case #3. | ||
6517 | </p> | ||
6518 | <a name="security-certificates-validation-streams"></a><br /><hr /> | ||
6519 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6520 | <a name="rfc.section.13.7.2.3"></a><h3>13.7.2.3. | ||
6521 | Checking of Certificates in Long-Lived Streams</h3> | ||
6522 | |||
6523 | <p>Because XMPP uses long-lived XML streams, it is possible that a certificate presented during stream negotiation might expire or be revoked while the stream is still live (this is especially relevant in the context of server-to-server streams). Therefore, each party to a long-lived stream SHOULD: | ||
6524 | </p> | ||
6525 | <p> | ||
6526 | </p> | ||
6527 | <ol class="text"> | ||
6528 | <li>Cache the expiration date of the certificate presented by the other party and any certificates on which that certificate depends (such as a root or intermediate certificate for a certification authority), and close the stream when any such certificate expires, with a stream error of <reset/> (<a class='info' href='#streams-error-conditions-reset'>Section 4.9.3.16<span> (</span><span class='info'>reset</span><span>)</span></a>). | ||
6529 | </li> | ||
6530 | <li>Periodically query the Online Certificate Status Protocol <a class='info' href='#OCSP'>[OCSP]<span> (</span><span class='info'>Myers, M., Ankney, R., Malpani, A., Galperin, S., and C. Adams, “X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP,” June 1999.</span><span>)</span></a> responder listed in the Authority Information Access (AIA) extension of the certificate presented by the other party and any certificates on which that certificate depends (such as a root or intermediate certificate for a certification authority), and close the stream if any such certificate has been revoked, with a stream error of <reset/> (<a class='info' href='#streams-error-conditions-reset'>Section 4.9.3.16<span> (</span><span class='info'>reset</span><span>)</span></a>). It is RECOMMENDED to query the OSCP responder at or near the time communicated via the nextUpdate field received in the OCSP response or, if the nextUpdate field is not set, to query every 24 hours. | ||
6531 | </li> | ||
6532 | </ol><p> | ||
6533 | |||
6534 | </p> | ||
6535 | <p>After the stream is closed, the initiating entity from the closed stream will need to reconnect and the receiving entity will need to authenticate the initiating entity based on whatever certificate it presents during negotiation of the new stream. | ||
6536 | </p> | ||
6537 | <a name="security-certificates-validation-extensions"></a><br /><hr /> | ||
6538 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6539 | <a name="rfc.section.13.7.2.4"></a><h3>13.7.2.4. | ||
6540 | Use of Certificates in XMPP Extensions</h3> | ||
6541 | |||
6542 | <p>Certificates MAY be used in extensions to XMPP for the purpose of application-layer encryption or authentication above the level of XML streams (e.g., for end-to-end encryption). Such extensions will define their own certificate handling rules. At a minimum, such extensions are encouraged to remain consistent with the rules defined in this specification, specifying additional rules only when necessary. | ||
6543 | </p> | ||
6544 | <a name="security-mti"></a><br /><hr /> | ||
6545 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6546 | <a name="rfc.section.13.8"></a><h3>13.8. | ||
6547 | Mandatory-to-Implement TLS and SASL Technologies</h3> | ||
6548 | |||
6549 | <p>The following TLS ciphersuites and SASL mechanisms are mandatory-to-implement (naturally, implementations MAY support other ciphersuites and mechanisms as well). For security considerations related to TLS ciphersuites, see <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a> and <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>. For security considerations related to SASL mechanisms, see <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a>, <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>, and specifications for particular SASL mechanisms such as <a class='info' href='#SCRAM'>[SCRAM]<span> (</span><span class='info'>Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, “Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms,” July 2010.</span><span>)</span></a>, <a class='info' href='#DIGEST-MD5'>[DIGEST‑MD5]<span> (</span><span class='info'>Leach, P. and C. Newman, “Using Digest Authentication as a SASL Mechanism,” May 2000.</span><span>)</span></a>, and <a class='info' href='#PLAIN'>[PLAIN]<span> (</span><span class='info'>Zeilenga, K., “The PLAIN Simple Authentication and Security Layer (SASL) Mechanism,” August 2006.</span><span>)</span></a>. | ||
6550 | </p> | ||
6551 | <a name="security-mti-auth"></a><br /><hr /> | ||
6552 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6553 | <a name="rfc.section.13.8.1"></a><h3>13.8.1. | ||
6554 | For Authentication Only</h3> | ||
6555 | |||
6556 | <p>For authentication only, servers and clients MUST support | ||
6557 | the SASL Salted Challenge Response Authentication Mechanism | ||
6558 | <a class='info' href='#SCRAM'>[SCRAM]<span> (</span><span class='info'>Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, “Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms,” July 2010.</span><span>)</span></a> -- in particular, the SCRAM-SHA-1 and SCRAM-SHA-1-PLUS variants. | ||
6559 | </p> | ||
6560 | <p></p> | ||
6561 | <blockquote class="text"> | ||
6562 | <p>Security Warning: Even though it is possible to complete authentication only without confidentiality, it is RECOMMENDED for servers and clients to protect the stream with TLS before attempting authentication with SASL, both to help protect the information exchanged during SASL negotiation and to help prevent certain downgrade attacks as described under <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a> and <a class='info' href='#security-reuse-tls'>Section 13.9.5<span> (</span><span class='info'>Use of TLS</span><span>)</span></a>. Even if TLS is used, implementations SHOULD also enforce channel binding as described under <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a>. | ||
6563 | </p> | ||
6564 | </blockquote> | ||
6565 | |||
6566 | <p></p> | ||
6567 | <blockquote class="text"> | ||
6568 | <p>Interoperability Note: The SCRAM-SHA-1 or SASL-SCRAM-SHA-1-PLUS variants of the SCRAM mechanism replace the SASL DIGEST-MD5 mechanism as XMPP's mandatory-to-implement password-based method for authentication only. For backward-compatibility with existing deployed infrastructure, implementations are encouraged to continue supporting the DIGEST-MD5 mechanism as specified in <a class='info' href='#DIGEST-MD5'>[DIGEST‑MD5]<span> (</span><span class='info'>Leach, P. and C. Newman, “Using Digest Authentication as a SASL Mechanism,” May 2000.</span><span>)</span></a>; however, there are known interoperability issues with DIGEST-MD5 that make it impractical in the long term. | ||
6569 | </p> | ||
6570 | </blockquote> | ||
6571 | |||
6572 | <a name="security-mti-conf"></a><br /><hr /> | ||
6573 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6574 | <a name="rfc.section.13.8.2"></a><h3>13.8.2. | ||
6575 | For Confidentiality Only</h3> | ||
6576 | |||
6577 | <p>For confidentiality only, servers MUST support TLS with the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite. | ||
6578 | </p> | ||
6579 | <p></p> | ||
6580 | <blockquote class="text"> | ||
6581 | <p>Security Warning: Because a connection with confidentiality only has weaker security properties than a connection with both confidentiality and authentication, it is RECOMMENDED for servers and clients to prefer connections with both qualities (e.g., by protecting the stream with TLS before attempting authentication with SASL). In practice, confidentiality only is employed merely for server-to-server connections when the peer server does not present a trusted certificate and the servers use Server Dialback <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a> for weak identity verification, but TLS with confidentiality only is still desirable to protect the connection against casual eavesdropping. | ||
6582 | </p> | ||
6583 | </blockquote> | ||
6584 | |||
6585 | <a name="security-mti-bothpass"></a><br /><hr /> | ||
6586 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6587 | <a name="rfc.section.13.8.3"></a><h3>13.8.3. | ||
6588 | For Confidentiality and Authentication with Passwords</h3> | ||
6589 | |||
6590 | <p>For both confidentiality and authentication with passwords, servers and clients MUST implement TLS with the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite plus SASL SCRAM, in particular the SCRAM‑SHA‑1 and SCRAM‑SHA‑1‑PLUS variants (with SCRAM‑SHA1‑PLUS being preferred, as described under <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a>). | ||
6591 | </p> | ||
6592 | <p>As further explained in the following Security Warning, in certain circumstances a server MAY offer TLS with the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite plus SASL PLAIN when it is not possible to offer more secure alternatives; in addition, clients SHOULD implement PLAIN over TLS in order to maximize interoperability with servers that are not able to deploy more secure alternatives. | ||
6593 | </p> | ||
6594 | <p></p> | ||
6595 | <blockquote class="text"> | ||
6596 | <p>Security Warning: In practice, many | ||
6597 | servers offer, and many clients use, TLS plus SASL PLAIN. The | ||
6598 | SCRAM-SHA-1 and especially SCRAM-SHA-1-PLUS variants of the | ||
6599 | SCRAM mechanism are strongly preferred over the PLAIN | ||
6600 | mechanism because of their superior security properties | ||
6601 | (including for SCRAM-SHA-1-PLUS the ability to enforce channel | ||
6602 | binding as described under | ||
6603 | <a class='info' href='#security-reuse-sasl'>Section 13.9.4<span> (</span><span class='info'>Use of SASL</span><span>)</span></a>). A client SHOULD treat | ||
6604 | TLS plus SASL PLAIN as a technology of last resort to be used | ||
6605 | only when interacting with a server that does not offer SCRAM | ||
6606 | (or other alternatives that are more secure than TLS plus SASL | ||
6607 | PLAIN), MUST prefer more secure mechanisms (e.g., EXTERNAL, | ||
6608 | SCRAM-SHA-1-PLUS, SCRAM-SHA-1, or the older DIGEST-MD5 | ||
6609 | mechanism) to the PLAIN mechanism, and MUST NOT use the PLAIN | ||
6610 | mechanism if the stream does not at a minimum have | ||
6611 | confidentiality and integrity protection via TLS with full | ||
6612 | certificate validation as described under | ||
6613 | <a class='info' href='#security-certificates-validation-server'>Section 13.7.2.1<span> (</span><span class='info'>Server Certificates</span><span>)</span></a>. A | ||
6614 | server MUST NOT offer SASL PLAIN if the confidentiality and | ||
6615 | integrity of the stream are not protected via TLS or an | ||
6616 | equivalent security layer. A server SHOULD NOT offer TLS plus | ||
6617 | SASL PLAIN unless it is unable to offer some variant of SASL | ||
6618 | SCRAM (or other alternatives that are more secure than TLS | ||
6619 | plus SASL PLAIN), e.g., because the XMPP service depends for | ||
6620 | authentication purposes on a database or directory that is not | ||
6621 | under the control of the XMPP administrators, such as | ||
6622 | Pluggable Authentication Modules (PAM), an Lightweight | ||
6623 | Directory Access Protocol (LDAP) directory <a class='info' href='#LDAP'>[LDAP]<span> (</span><span class='info'>Zeilenga, K., “Lightweight Directory Access Protocol (LDAP): Technical Specification Road Map,” June 2006.</span><span>)</span></a>, or an Authentication, Authorization, and Accounting (AAA) key management protocol (for guidance, refer to <a class='info' href='#AAA'>[AAA]<span> (</span><span class='info'>Housley, R. and B. Aboba, “Guidance for Authentication, Authorization, and Accounting (AAA) Key Management,” July 2007.</span><span>)</span></a>). However, offering TLS plus SASL PLAIN even when the server supports more secure alternatives might be appropriate if the server needs to enable interoperability with an installed base of clients that do not yet support SCRAM or other alternatives that are more secure than TLS plus SASL PLAIN. | ||
6624 | </p> | ||
6625 | </blockquote> | ||
6626 | |||
6627 | <a name="security-mti-bothnopass"></a><br /><hr /> | ||
6628 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6629 | <a name="rfc.section.13.8.4"></a><h3>13.8.4. | ||
6630 | For Confidentiality and Authentication without Passwords</h3> | ||
6631 | |||
6632 | <p>For both confidentiality and authentication without passwords, servers MUST and clients SHOULD implement TLS with the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite plus the SASL EXTERNAL mechanism (see Appendix A of <a class='info' href='#SASL'>[SASL]<span> (</span><span class='info'>Melnikov, A. and K. Zeilenga, “Simple Authentication and Security Layer (SASL),” June 2006.</span><span>)</span></a>) with PKIX certificates. | ||
6633 | </p> | ||
6634 | <a name="security-reuse"></a><br /><hr /> | ||
6635 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6636 | <a name="rfc.section.13.9"></a><h3>13.9. | ||
6637 | Technology Reuse</h3> | ||
6638 | |||
6639 | <a name="security-reuse-base64"></a><br /><hr /> | ||
6640 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6641 | <a name="rfc.section.13.9.1"></a><h3>13.9.1. | ||
6642 | Use of Base 64 in SASL</h3> | ||
6643 | |||
6644 | <p>Both the client and the server MUST verify any base 64 data received during <a class='info' href='#sasl'>SASL negotiation<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a>. An implementation MUST reject (not ignore) any characters that are not explicitly allowed by the base 64 alphabet; this helps to guard against creation of a covert channel that could be used to "leak" information. | ||
6645 | </p> | ||
6646 | <p>An implementation MUST NOT break on invalid input and MUST reject any sequence of base 64 characters containing the pad ('=') character if that character is included as something other than the last character of the data (e.g., "=AAA" or "BBBB=CCC"); this helps to guard against buffer overflow attacks and other attacks on the implementation. | ||
6647 | </p> | ||
6648 | <p>While base 64 encoding visually hides otherwise easily recognized information (such as passwords), it does not provide any computational confidentiality. | ||
6649 | </p> | ||
6650 | <p>All uses of base 64 encoding MUST follow the definition in Section 4 of <a class='info' href='#BASE64'>[BASE64]<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a> and padding bits MUST be set to zero. | ||
6651 | </p> | ||
6652 | <a name="security-reuse-dns"></a><br /><hr /> | ||
6653 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6654 | <a name="rfc.section.13.9.2"></a><h3>13.9.2. | ||
6655 | Use of DNS</h3> | ||
6656 | |||
6657 | <p>XMPP typically relies on the Domain Name System | ||
6658 | (specifically <a class='info' href='#DNS-SRV'>[DNS‑SRV]<span> (</span><span class='info'>Gulbrandsen, A., Vixie, P., and L. Esibov, “A DNS RR for specifying the location of services (DNS SRV),” February 2000.</span><span>)</span></a> records) to resolve a | ||
6659 | fully qualified domain name to an IP address before a client connects to a server or before a peer server connects to another server. Before attempting to negotiate an XML stream, the initiating entity MUST NOT proceed until it has resolved the DNS domain name of the receiving entity as specified under <a class='info' href='#tcp'>Section 3<span> (</span><span class='info'>TCP Binding</span><span>)</span></a> (although it is not necessary to resolve the DNS domain name before each connection attempt, because DNS resolution results can be temporarily cached in accordance with time-to-live values). However, in the absence of a secure DNS option (e.g., as provided by <a class='info' href='#DNSSEC'>[DNSSEC]<span> (</span><span class='info'>Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, “DNS Security Introduction and Requirements,” March 2005.</span><span>)</span></a>), a malicious attacker with access to the DNS server data, or able to cause spoofed answers to be cached in a recursive resolver, can potentially cause the initiating entity to connect to any XMPP server chosen by the attacker. Deployment and validation of server certificates help to prevent such attacks. | ||
6660 | </p> | ||
6661 | <a name="security-reuse-hash"></a><br /><hr /> | ||
6662 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6663 | <a name="rfc.section.13.9.3"></a><h3>13.9.3. | ||
6664 | Use of Hash Functions</h3> | ||
6665 | |||
6666 | <p>XMPP itself does not directly mandate the use of any particular cryptographic hash function. However, technologies on which XMPP depends (e.g., TLS and particular SASL mechanisms), as well as various XMPP extensions, might make use of cryptographic hash functions. Those who implement XMPP technologies or who develop XMPP extensions are advised to closely monitor the state of the art regarding attacks against cryptographic hash functions in Internet protocols as they relate to XMPP. For helpful guidance, refer to <a class='info' href='#HASHES'>[HASHES]<span> (</span><span class='info'>Hoffman, P. and B. Schneier, “Attacks on Cryptographic Hashes in Internet Protocols,” November 2005.</span><span>)</span></a>. | ||
6667 | </p> | ||
6668 | <a name="security-reuse-sasl"></a><br /><hr /> | ||
6669 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6670 | <a name="rfc.section.13.9.4"></a><h3>13.9.4. | ||
6671 | Use of SASL</h3> | ||
6672 | |||
6673 | <p>Because the initiating entity chooses an acceptable SASL mechanism from the list presented by the receiving entity, the initiating entity depends on the receiving entity's list for authentication. This dependency introduces the possibility of a downgrade attack if an attacker can gain control of the channel and therefore present a weak list of mechanisms. To mitigate this attack, the parties SHOULD protect the channel using TLS before attempting SASL negotiation and either perform full certificate validation as described under <a class='info' href='#security-certificates-validation-server'>Section 13.7.2.1<span> (</span><span class='info'>Server Certificates</span><span>)</span></a> or use a SASL mechanism that provides channel bindings, such as SCRAM-SHA-1-PLUS. (Protecting the channel via TLS with full certificate validation can help to ensure the confidentiality and integrity of the information exchanged during SASL negotiation.) | ||
6674 | </p> | ||
6675 | <p>The SASL framework itself does not provide a method for binding SASL authentication to a security layer providing confidentiality and integrity protection that was negotiated at a lower layer (e.g., TLS). Such a binding is known as a "channel binding" (see <a class='info' href='#CHANNEL'>[CHANNEL]<span> (</span><span class='info'>Williams, N., “On the Use of Channel Bindings to Secure Channels,” November 2007.</span><span>)</span></a>). Some SASL mechanisms provide channel bindings, which in the case of XMPP would typically be a binding to TLS (see <a class='info' href='#CHANNEL-TLS'>[CHANNEL‑TLS]<span> (</span><span class='info'>Altman, J., Williams, N., and L. Zhu, “Channel Bindings for TLS,” July 2010.</span><span>)</span></a>). If a SASL mechanism provides a channel binding (e.g., this is true of <a class='info' href='#SCRAM'>[SCRAM]<span> (</span><span class='info'>Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, “Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms,” July 2010.</span><span>)</span></a>), then XMPP entities using that mechanism SHOULD prefer the channel binding variant (e.g., preferring "SCRAM-SHA-1-PLUS" over "SCRAM-SHA-1"). If a SASL mechanism does not provide a channel binding, then the mechanism cannot provide a way to verify that the source and destination end points to which the lower layer's security is bound are equivalent to the end points that SASL is authenticating; furthermore, if the end points are not identical, then the lower layer's security cannot be trusted to protect data transmitted between the SASL-authenticated entities. In such a situation, a SASL security layer SHOULD be negotiated that effectively ignores the presence of the lower-layer security. | ||
6676 | </p> | ||
6677 | <p>Many deployed XMPP services authenticate client connections by means of passwords. It is well known that most human users choose relatively weak passwords. Although service provisioning is out of scope for this document, XMPP servers that allow password-based authentication SHOULD enforce minimal criteria for password strength to help prevent dictionary attacks. Because all password-based authentication mechanisms are susceptible to password guessing attacks, XMPP servers MUST limit the number of retries allowed during SASL authentication, as described under <a class='info' href='#sasl-process-neg-failure'>Section 6.4.5<span> (</span><span class='info'>SASL Failure</span><span>)</span></a>. | ||
6678 | </p> | ||
6679 | <p>Some SASL mechanisms (e.g., <a class='info' href='#ANONYMOUS'>[ANONYMOUS]<span> (</span><span class='info'>Zeilenga, K., “Anonymous Simple Authentication and Security Layer (SASL) Mechanism,” June 2006.</span><span>)</span></a>) do not provide strong peer entity authentication of the client to the server. Service administrators are advised to enable such mechanisms with caution. Best practices for the use of the SASL ANONYMOUS mechanism in XMPP are described in <a class='info' href='#XEP-0175'>[XEP‑0175]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices for Use of SASL ANONYMOUS,” September 2009.</span><span>)</span></a>. | ||
6680 | </p> | ||
6681 | <a name="security-reuse-tls"></a><br /><hr /> | ||
6682 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6683 | <a name="rfc.section.13.9.5"></a><h3>13.9.5. | ||
6684 | Use of TLS</h3> | ||
6685 | |||
6686 | <p>Implementations of TLS typically support multiple versions of the Transport Layer Security protocol as well as the older Secure Sockets Layer (SSL) protocol. Because of known security vulnerabilities, XMPP servers and clients MUST NOT request, offer, or use SSL 2.0. For further details, see Appendix E.2 of <a class='info' href='#TLS'>[TLS]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a> along with <a class='info' href='#TLS-SSL2'>[TLS‑SSL2]<span> (</span><span class='info'>Turner, S. and T. Polk, “Prohibiting Secure Sockets Layer (SSL) Version 2.0,” March 2011.</span><span>)</span></a>. | ||
6687 | </p> | ||
6688 | <p>To prevent man-in-the-middle attacks, the TLS client (which might be an XMPP client or an XMPP server) MUST verify the certificate of the TLS server and MUST check its understanding of the server FQDN against the server's identity as presented in the TLS Certificate message as described under <a class='info' href='#security-certificates-validation-server'>Section 13.7.2.1<span> (</span><span class='info'>Server Certificates</span><span>)</span></a> (for further details, see <a class='info' href='#TLS-CERTS'>[TLS‑CERTS]<span> (</span><span class='info'>Saint-Andre, P. and J. Hodges, “Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS),” March 2011.</span><span>)</span></a>. | ||
6689 | </p> | ||
6690 | <p>Support for TLS renegotiation is strictly OPTIONAL. However, implementations that support TLS renegotiation MUST implement and use the TLS Renegotiation Extension <a class='info' href='#TLS-NEG'>[TLS‑NEG]<span> (</span><span class='info'>Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, “Transport Layer Security (TLS) Renegotiation Indication Extension,” February 2010.</span><span>)</span></a>. Further details are provided under <a class='info' href='#tls-rules-renegotiation'>Section 5.3.5<span> (</span><span class='info'>TLS Renegotiation</span><span>)</span></a>. | ||
6691 | </p> | ||
6692 | <a name="security-reuse-utf8"></a><br /><hr /> | ||
6693 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6694 | <a name="rfc.section.13.9.6"></a><h3>13.9.6. | ||
6695 | Use of UTF-8</h3> | ||
6696 | |||
6697 | <p>The use of UTF-8 makes it possible to transport non-ASCII characters, and thus enables character "spoofing" scenarios, in which a displayed value appears to be something other than it is. Furthermore, there are known attack scenarios related to the decoding of UTF-8 data. On both of these points, refer to <a class='info' href='#UTF-8'>[UTF‑8]<span> (</span><span class='info'>Yergeau, F., “UTF-8, a transformation format of ISO 10646,” November 2003.</span><span>)</span></a> for more information. | ||
6698 | </p> | ||
6699 | <a name="security-reuse-xml"></a><br /><hr /> | ||
6700 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6701 | <a name="rfc.section.13.9.7"></a><h3>13.9.7. | ||
6702 | Use of XML</h3> | ||
6703 | |||
6704 | <p>Because XMPP is an application profile of the Extensible Markup Language <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>, many of the security considerations described in <a class='info' href='#XML-MEDIA'>[XML‑MEDIA]<span> (</span><span class='info'>Murata, M., St. Laurent, S., and D. Kohn, “XML Media Types,” January 2001.</span><span>)</span></a> and <a class='info' href='#XML-GUIDE'>[XML‑GUIDE]<span> (</span><span class='info'>Hollenbeck, S., Rose, M., and L. Masinter, “Guidelines for the Use of Extensible Markup Language (XML) within IETF Protocols,” January 2003.</span><span>)</span></a> also apply to XMPP. Several aspects of XMPP mitigate the risks described there, such as the prohibitions specified under <a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a> and the lack of external references to style sheets or transformations, but these mitigating factors are by no means comprehensive. | ||
6705 | </p> | ||
6706 | <a name="security-leaks"></a><br /><hr /> | ||
6707 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6708 | <a name="rfc.section.13.10"></a><h3>13.10. | ||
6709 | Information Leaks</h3> | ||
6710 | |||
6711 | <a name="security-leaks-ipaddress"></a><br /><hr /> | ||
6712 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6713 | <a name="rfc.section.13.10.1"></a><h3>13.10.1. | ||
6714 | IP Addresses</h3> | ||
6715 | |||
6716 | <p>A client's IP address and method of access MUST NOT be made public by a server (e.g., as typically occurs in <a class='info' href='#IRC'>[IRC]<span> (</span><span class='info'>Kalt, C., “Internet Relay Chat: Architecture,” April 2000.</span><span>)</span></a>). | ||
6717 | </p> | ||
6718 | <a name="security-leaks-presence"></a><br /><hr /> | ||
6719 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6720 | <a name="rfc.section.13.10.2"></a><h3>13.10.2. | ||
6721 | Presence Information</h3> | ||
6722 | |||
6723 | <p>One of the core aspects of XMPP is presence: information about the network availability of an XMPP entity (i.e., whether the entity is currently online or offline). A "presence leak" occurs when an entity's network availability is inadvertently and involuntarily revealed to a second entity that is not authorized to know the first entity's network availability. | ||
6724 | </p> | ||
6725 | <p>Although presence is discussed more fully in <a class='info' href='#XMPP-IM'>[XMPP‑IM]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence,” March 2011.</span><span>)</span></a>, it is important to note that an XMPP server MUST NOT leak presence. In particular at the core XMPP level, real-time addressing and network availability is associated with a specific connected resource; therefore, any disclosure of a connected resource's full JID comprises a presence leak. To help prevent such a presence leak, a server MUST NOT return different stanza errors depending on whether a potential attacker sends XML stanzas to the entity's bare JID (<localpart@domainpart>) or full JID (<localpart@domainpart/resourcepart>). | ||
6726 | </p> | ||
6727 | <a name="security-harvesting"></a><br /><hr /> | ||
6728 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6729 | <a name="rfc.section.13.11"></a><h3>13.11. | ||
6730 | Directory Harvesting</h3> | ||
6731 | |||
6732 | <p>If a server generates an error stanza in response to receiving a stanza for a user account that does not exist, using the <service-unavailable/> stanza error condition (<a class='info' href='#stanzas-error-conditions-service-unavailable'>Section 8.3.3.19<span> (</span><span class='info'>service-unavailable</span><span>)</span></a>) can help protect against directory harvesting attacks, since this is the same error condition that is returned if, for instance, the namespace of an IQ child element is not understood, or if "offline message storage" (<a class='info' href='#XEP-0160'>[XEP‑0160]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices for Handling Offline Messages,” January 2006.</span><span>)</span></a>) or message forwarding is not enabled for a domain. However, subtle differences in the exact XML of error stanzas, as well as in the timing with which such errors are returned, can enable an attacker to determine the network presence of a user when more advanced blocking technologies are not used (see for instance <a class='info' href='#XEP-0016'>[XEP‑0016]<span> (</span><span class='info'>Millard, P. and P. Saint-Andre, “Privacy Lists,” February 2007.</span><span>)</span></a> and <a class='info' href='#XEP-0191'>[XEP‑0191]<span> (</span><span class='info'>Saint-Andre, P., “Simple Communications Blocking,” February 2007.</span><span>)</span></a>). Therefore, a server that exercises a higher level of caution might not return any error at all in response to certain kinds of received stanzas, so that a non-existent user appears to behave like a user that has no interest in conversing with the sender. | ||
6733 | </p> | ||
6734 | <a name="security-dos"></a><br /><hr /> | ||
6735 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6736 | <a name="rfc.section.13.12"></a><h3>13.12. | ||
6737 | Denial of Service</h3> | ||
6738 | |||
6739 | <p><a class='info' href='#DOS'>[DOS]<span> (</span><span class='info'>Handley, M., Rescorla, E., and IAB, “Internet Denial-of-Service Considerations,” December 2006.</span><span>)</span></a> defines denial of service as follows: | ||
6740 | </p> | ||
6741 | <p> | ||
6742 | </p> | ||
6743 | <blockquote class="text"><dl> | ||
6744 | <dt></dt> | ||
6745 | <dd>A denial-of-service (DoS) attack is an attack in which one or more machines target a victim and attempt to prevent the victim from doing useful work. The victim can be a network server, client or router, a network link or an entire network, an individual Internet user or a company doing business using the Internet, an Internet Service Provider (ISP), country, or any combination of or variant on these. | ||
6746 | </dd> | ||
6747 | </dl></blockquote><p> | ||
6748 | |||
6749 | </p> | ||
6750 | <p>Some considerations discussed in this document help to prevent denial-of-service attacks (e.g., the mandate that a server MUST NOT process XML stanzas from clients that have not yet provided appropriate authentication credentials and MUST NOT process XML stanzas from peer servers whose identity it has not either authenticated via SASL or weakly verified via Server Dialback). | ||
6751 | </p> | ||
6752 | <p>In addition, <a class='info' href='#XEP-0205'>[XEP‑0205]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices to Discourage Denial of Service Attacks,” January 2009.</span><span>)</span></a> provides a detailed discussion of potential denial-of-service attacks against XMPP systems along with best practices for preventing such attacks. The recommendations include: | ||
6753 | </p> | ||
6754 | <p> | ||
6755 | </p> | ||
6756 | <ol class="text"> | ||
6757 | <li>A server implementation SHOULD enable a server administrator to limit the number of TCP connections that it will accept from a given IP address at any one time. If an entity attempts to connect but the maximum number of TCP connections has been reached, the receiving server MUST NOT allow the new connection to proceed. | ||
6758 | </li> | ||
6759 | <li>A server implementation SHOULD enable a server administrator to limit the number of TCP connection attempts that it will accept from a given IP address in a given time period. If an entity attempts to connect but the maximum number of connection attempts has been reached, the receiving server MUST NOT allow the new connection to proceed. | ||
6760 | </li> | ||
6761 | <li>A server implementation SHOULD enable a server administrator to limit the number of connected resources it will allow an account to bind at any one time. If a client attempts to bind a resource but it has already reached the configured number of allowable resources, the receiving server MUST return a <resource-constraint/> stanza error (<a class='info' href='#stanzas-error-conditions-resource-constraint'>Section 8.3.3.18<span> (</span><span class='info'>resource-constraint</span><span>)</span></a>). | ||
6762 | </li> | ||
6763 | <li>A server implementation SHOULD enable a server administrator to limit the size of stanzas it will accept from a connected client or peer server (where "size" is inclusive of all XML markup as defined in Section 2.4 of <a class='info' href='#XML'>[XML]<span> (</span><span class='info'>Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “Extensible Markup Language (XML) 1.0 (Fifth Edition),” November 2008.</span><span>)</span></a>, from the opening "<" character of the stanza to the closing ">" character). A deployed server's maximum stanza size MUST NOT be smaller than 10000 bytes, which reflects a reasonable compromise between the benefits of expressiveness for originating entities and the costs of stanza processing for servers. A server implementation SHOULD NOT blindly set 10000 bytes as the value for all deployments but instead SHOULD enable server administrators to set their own limits. If a connected resource or peer server sends a stanza that violates the upper limit, the receiving server MUST either return a <policy-violation/> stanza error (<a class='info' href='#stanzas-error-conditions-policy-violation'>Section 8.3.3.12<span> (</span><span class='info'>policy-violation</span><span>)</span></a>), thus allowing the sender to recover, or close the stream with a <policy-violation/> stream error (<a class='info' href='#streams-error-conditions-policy-violation'>Section 4.9.3.14<span> (</span><span class='info'>policy-violation</span><span>)</span></a>). | ||
6764 | </li> | ||
6765 | <li>A server implementation SHOULD enable a server administrator to limit the number of XML stanzas that a connected client is allowed to send to distinct recipients within a given time period. If a connected client sends too many stanzas to distinct recipients in a given time period, the receiving server SHOULD NOT process the stanza and instead SHOULD return a <policy-violation/> stanza error (<a class='info' href='#stanzas-error-conditions-policy-violation'>Section 8.3.3.12<span> (</span><span class='info'>policy-violation</span><span>)</span></a>). | ||
6766 | </li> | ||
6767 | <li>A server implementation SHOULD enable a server administrator to limit the amount of bandwidth it will allow a connected client or peer server to use in a given time period. | ||
6768 | </li> | ||
6769 | <li>A server implementation MAY enable a server administrator to limit the types of stanzas (based on the extended content "payload") that it will allow a connected resource or peer server send over an active connection. Such limits and restrictions are a matter of deployment policy. | ||
6770 | </li> | ||
6771 | <li>A server implementation MAY refuse to route or deliver any stanza that it considers to be abusive, with or without returning an error to the sender. | ||
6772 | </li> | ||
6773 | </ol><p> | ||
6774 | |||
6775 | </p> | ||
6776 | <p>For more detailed recommendations regarding denial-of-service attacks in XMPP systems, refer to <a class='info' href='#XEP-0205'>[XEP‑0205]<span> (</span><span class='info'>Saint-Andre, P., “Best Practices to Discourage Denial of Service Attacks,” January 2009.</span><span>)</span></a>. | ||
6777 | </p> | ||
6778 | <a name="security-firewalls"></a><br /><hr /> | ||
6779 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6780 | <a name="rfc.section.13.13"></a><h3>13.13. | ||
6781 | Firewalls</h3> | ||
6782 | |||
6783 | <p>Although DNS SRV records can instruct connecting entities to use TCP ports other than 5222 (client-to-server) and 5269 (server-to-server), communication using XMPP typically occurs over those ports, which are registered with the IANA (see <a class='info' href='#iana'>Section 14<span> (</span><span class='info'>IANA Considerations</span><span>)</span></a>). Use of these well-known ports allows administrators to easily enable or disable XMPP activity through existing and commonly deployed firewalls. | ||
6784 | </p> | ||
6785 | <a name="security-federation"></a><br /><hr /> | ||
6786 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6787 | <a name="rfc.section.13.14"></a><h3>13.14. | ||
6788 | Interdomain Federation</h3> | ||
6789 | |||
6790 | <p>The term "federation" is commonly used to describe communication between two servers. | ||
6791 | </p> | ||
6792 | <p>Because service provisioning is a matter of policy, it is OPTIONAL for any given server to support federation. If a particular server enables federation, it SHOULD enable strong security as previously described to ensure both authentication and confidentiality; compliant implementations SHOULD support TLS and SASL for this purpose. | ||
6793 | </p> | ||
6794 | <p>Before RFC 3920 defined TLS plus SASL EXTERNAL with certificates for encryption and authentication of server-to-server streams, the only method for weak identity verification of a peer server was Server Dialback as defined in <a class='info' href='#XEP-0220'>[XEP‑0220]<span> (</span><span class='info'>Miller, J., Saint-Andre, P., and P. Hancke, “Server Dialback,” March 2010.</span><span>)</span></a>. Even when <a class='info' href='#DNSSEC'>[DNSSEC]<span> (</span><span class='info'>Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, “DNS Security Introduction and Requirements,” March 2005.</span><span>)</span></a> is used, Server Dialback provides only weak identity verification and provides no confidentiality or integrity. At the time of writing, Server Dialback is still the most widely used technique for some level of assurance over server-to-server streams. This reality introduces the possibility of a downgrade attack from TLS + SASL EXTERNAL to Server Dialback if an attacker can gain control of the channel and therefore convince the initiating server that the receiving server does not support TLS or does not have an appropriate certificate. To help prevent this attack, the parties SHOULD protect the channel using TLS before proceeding, even if the presented certificates are self-signed or otherwise untrusted. | ||
6795 | </p> | ||
6796 | <a name="security-nonrepudiation"></a><br /><hr /> | ||
6797 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6798 | <a name="rfc.section.13.15"></a><h3>13.15. | ||
6799 | Non-Repudiation</h3> | ||
6800 | |||
6801 | <p>Systems that provide both peer entity authentication and data integrity have the potential to enable an entity to prove to a third party that another entity intended to send particular data. Although XMPP systems can provide both peer entity authentication and data integrity, XMPP was never designed to provide non-repudiation. | ||
6802 | </p> | ||
6803 | <a name="iana"></a><br /><hr /> | ||
6804 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6805 | <a name="rfc.section.14"></a><h3>14. | ||
6806 | IANA Considerations</h3> | ||
6807 | |||
6808 | <p>The following subsections update the registrations provided in <a class='info' href='#RFC3920'>[RFC3920]<span> (</span><span class='info'>Saint-Andre, P., Ed., “Extensible Messaging and Presence Protocol (XMPP): Core,” October 2004.</span><span>)</span></a>. This section is to be interpreted according to <a class='info' href='#IANA-GUIDE'>[IANA‑GUIDE]<span> (</span><span class='info'>Narten, T. and H. Alvestrand, “Guidelines for Writing an IANA Considerations Section in RFCs,” May 2008.</span><span>)</span></a>. | ||
6809 | </p> | ||
6810 | <a name="iana-ns-tls"></a><br /><hr /> | ||
6811 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6812 | <a name="rfc.section.14.1"></a><h3>14.1. | ||
6813 | XML Namespace Name for TLS Data</h3> | ||
6814 | |||
6815 | <p>A URN sub-namespace for STARTTLS negotiation data in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in <a class='info' href='#XML-REG'>[XML‑REG]<span> (</span><span class='info'>Mealling, M., “The IETF XML Registry,” January 2004.</span><span>)</span></a>.) | ||
6816 | </p> | ||
6817 | <p></p> | ||
6818 | <blockquote class="text"><dl> | ||
6819 | <dt>URI:</dt> | ||
6820 | <dd>urn:ietf:params:xml:ns:xmpp-tls | ||
6821 | </dd> | ||
6822 | <dt>Specification:</dt> | ||
6823 | <dd>RFC 6120 | ||
6824 | </dd> | ||
6825 | <dt>Description:</dt> | ||
6826 | <dd>This is the XML namespace name for STARTTLS negotiation data in the Extensible Messaging and Presence Protocol (XMPP) as defined by RFC 6120. | ||
6827 | </dd> | ||
6828 | <dt>Registrant Contact:</dt> | ||
6829 | <dd>IESG <iesg@ietf.org> | ||
6830 | </dd> | ||
6831 | </dl></blockquote> | ||
6832 | |||
6833 | <a name="iana-ns-sasl"></a><br /><hr /> | ||
6834 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6835 | <a name="rfc.section.14.2"></a><h3>14.2. | ||
6836 | XML Namespace Name for SASL Data</h3> | ||
6837 | |||
6838 | <p>A URN sub-namespace for SASL negotiation data in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in <a class='info' href='#XML-REG'>[XML‑REG]<span> (</span><span class='info'>Mealling, M., “The IETF XML Registry,” January 2004.</span><span>)</span></a>.) | ||
6839 | </p> | ||
6840 | <p></p> | ||
6841 | <blockquote class="text"><dl> | ||
6842 | <dt>URI:</dt> | ||
6843 | <dd>urn:ietf:params:xml:ns:xmpp-sasl | ||
6844 | </dd> | ||
6845 | <dt>Specification:</dt> | ||
6846 | <dd>RFC 6120 | ||
6847 | </dd> | ||
6848 | <dt>Description:</dt> | ||
6849 | <dd>This is the XML namespace name for SASL negotiation data in the Extensible Messaging and Presence Protocol (XMPP) as defined by RFC 6120. | ||
6850 | </dd> | ||
6851 | <dt>Registrant Contact:</dt> | ||
6852 | <dd>IESG <iesg@ietf.org> | ||
6853 | </dd> | ||
6854 | </dl></blockquote> | ||
6855 | |||
6856 | <a name="iana-ns-streams"></a><br /><hr /> | ||
6857 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6858 | <a name="rfc.section.14.3"></a><h3>14.3. | ||
6859 | XML Namespace Name for Stream Errors</h3> | ||
6860 | |||
6861 | <p>A URN sub-namespace for stream error data in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in <a class='info' href='#XML-REG'>[XML‑REG]<span> (</span><span class='info'>Mealling, M., “The IETF XML Registry,” January 2004.</span><span>)</span></a>.) | ||
6862 | </p> | ||
6863 | <p></p> | ||
6864 | <blockquote class="text"><dl> | ||
6865 | <dt>URI:</dt> | ||
6866 | <dd>urn:ietf:params:xml:ns:xmpp-streams | ||
6867 | </dd> | ||
6868 | <dt>Specification:</dt> | ||
6869 | <dd>RFC 6120 | ||
6870 | </dd> | ||
6871 | <dt>Description:</dt> | ||
6872 | <dd>This is the XML namespace name for stream error data in the Extensible Messaging and Presence Protocol (XMPP) as defined by RFC 6120. | ||
6873 | </dd> | ||
6874 | <dt>Registrant Contact:</dt> | ||
6875 | <dd>IESG <iesg@ietf.org> | ||
6876 | </dd> | ||
6877 | </dl></blockquote> | ||
6878 | |||
6879 | <a name="iana-ns-bind"></a><br /><hr /> | ||
6880 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6881 | <a name="rfc.section.14.4"></a><h3>14.4. | ||
6882 | XML Namespace Name for Resource Binding</h3> | ||
6883 | |||
6884 | <p>A URN sub-namespace for resource binding in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in <a class='info' href='#XML-REG'>[XML‑REG]<span> (</span><span class='info'>Mealling, M., “The IETF XML Registry,” January 2004.</span><span>)</span></a>.) | ||
6885 | </p> | ||
6886 | <p></p> | ||
6887 | <blockquote class="text"><dl> | ||
6888 | <dt>URI:</dt> | ||
6889 | <dd>urn:ietf:params:xml:ns:xmpp-bind | ||
6890 | </dd> | ||
6891 | <dt>Specification:</dt> | ||
6892 | <dd>RFC 6120 | ||
6893 | </dd> | ||
6894 | <dt>Description:</dt> | ||
6895 | <dd>This is the XML namespace name for resource binding in the Extensible Messaging and Presence Protocol (XMPP) as defined by RFC 6120. | ||
6896 | </dd> | ||
6897 | <dt>Registrant Contact:</dt> | ||
6898 | <dd>IESG <iesg@ietf.org> | ||
6899 | </dd> | ||
6900 | </dl></blockquote> | ||
6901 | |||
6902 | <a name="iana-ns-stanzas"></a><br /><hr /> | ||
6903 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6904 | <a name="rfc.section.14.5"></a><h3>14.5. | ||
6905 | XML Namespace Name for Stanza Errors</h3> | ||
6906 | |||
6907 | <p>A URN sub-namespace for stanza error data in the Extensible Messaging and Presence Protocol (XMPP) is defined as follows. (This namespace name adheres to the format defined in <a class='info' href='#XML-REG'>[XML‑REG]<span> (</span><span class='info'>Mealling, M., “The IETF XML Registry,” January 2004.</span><span>)</span></a>.) | ||
6908 | </p> | ||
6909 | <p></p> | ||
6910 | <blockquote class="text"><dl> | ||
6911 | <dt>URI:</dt> | ||
6912 | <dd>urn:ietf:params:xml:ns:xmpp-stanzas | ||
6913 | </dd> | ||
6914 | <dt>Specification:</dt> | ||
6915 | <dd>RFC 6120 | ||
6916 | </dd> | ||
6917 | <dt>Description:</dt> | ||
6918 | <dd>This is the XML namespace name for stanza error data in the Extensible Messaging and Presence Protocol (XMPP) as defined by RFC 6120. | ||
6919 | </dd> | ||
6920 | <dt>Registrant Contact:</dt> | ||
6921 | <dd>IESG <iesg@ietf.org> | ||
6922 | </dd> | ||
6923 | </dl></blockquote> | ||
6924 | |||
6925 | <a name="iana-gssapi"></a><br /><hr /> | ||
6926 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6927 | <a name="rfc.section.14.6"></a><h3>14.6. | ||
6928 | GSSAPI Service Name</h3> | ||
6929 | |||
6930 | <p>The IANA has registered "xmpp" as a <a class='info' href='#GSS-API'>[GSS‑API]<span> (</span><span class='info'>Linn, J., “Generic Security Service Application Program Interface Version 2, Update 1,” January 2000.</span><span>)</span></a> service name, as defined under <a class='info' href='#sasl-def'>Section 6.6<span> (</span><span class='info'>SASL Definition</span><span>)</span></a>. | ||
6931 | </p> | ||
6932 | <a name="iana-ports"></a><br /><hr /> | ||
6933 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6934 | <a name="rfc.section.14.7"></a><h3>14.7. | ||
6935 | Port Numbers and Service Names</h3> | ||
6936 | |||
6937 | <p>The IANA has registered "xmpp-client" and "xmpp-server" as keywords for <a class='info' href='#TCP'>[TCP]<span> (</span><span class='info'>Postel, J., “Transmission Control Protocol,” September 1981.</span><span>)</span></a> ports 5222 and 5269, respectively. In accordance with <a class='info' href='#IANA-PORTS'>[IANA‑PORTS]<span> (</span><span class='info'>Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. Cheshire, “Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Transport Protocol Port Number and Service Name Registry,” February 2011.</span><span>)</span></a>, this document updates the existing registration, as follows. | ||
6938 | </p> | ||
6939 | <p> | ||
6940 | </p> | ||
6941 | <blockquote class="text"><dl> | ||
6942 | <dt>Service Name:</dt> | ||
6943 | <dd>xmpp-client | ||
6944 | </dd> | ||
6945 | <dt>Transport Protocol:</dt> | ||
6946 | <dd>TCP | ||
6947 | </dd> | ||
6948 | <dt>Description:</dt> | ||
6949 | <dd>A service offering support for connections by XMPP client applications | ||
6950 | </dd> | ||
6951 | <dt>Registrant:</dt> | ||
6952 | <dd>IETF XMPP Working Group | ||
6953 | </dd> | ||
6954 | <dt>Contact:</dt> | ||
6955 | <dd>IESG <iesg@ietf.org> | ||
6956 | </dd> | ||
6957 | <dt>Reference:</dt> | ||
6958 | <dd>RFC 6120 | ||
6959 | </dd> | ||
6960 | <dt>Port Number:</dt> | ||
6961 | <dd>5222 | ||
6962 | </dd> | ||
6963 | </dl></blockquote><p> | ||
6964 | |||
6965 | </p> | ||
6966 | <p> | ||
6967 | </p> | ||
6968 | <blockquote class="text"><dl> | ||
6969 | <dt>Service Name:</dt> | ||
6970 | <dd>xmpp-server | ||
6971 | </dd> | ||
6972 | <dt>Transport Protocol:</dt> | ||
6973 | <dd>TCP | ||
6974 | </dd> | ||
6975 | <dt>Description:</dt> | ||
6976 | <dd>A service offering support for connections by XMPP server applications | ||
6977 | </dd> | ||
6978 | <dt>Registrant:</dt> | ||
6979 | <dd>IETF XMPP Working Group | ||
6980 | </dd> | ||
6981 | <dt>Contact:</dt> | ||
6982 | <dd>IESG <iesg@ietf.org> | ||
6983 | </dd> | ||
6984 | <dt>Reference:</dt> | ||
6985 | <dd>RFC 6120 | ||
6986 | </dd> | ||
6987 | <dt>Port Number:</dt> | ||
6988 | <dd>5269 | ||
6989 | </dd> | ||
6990 | </dl></blockquote><p> | ||
6991 | |||
6992 | </p> | ||
6993 | <a name="conformance"></a><br /><hr /> | ||
6994 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
6995 | <a name="rfc.section.15"></a><h3>15. | ||
6996 | Conformance Requirements</h3> | ||
6997 | |||
6998 | <p>This section describes a protocol feature set that summarizes the conformance requirements of this specification. This feature set is appropriate for use in software certification, interoperability testing, and implementation reports. For each feature, this section provides the following information: | ||
6999 | </p> | ||
7000 | <p> | ||
7001 | </p> | ||
7002 | <ul class="text"> | ||
7003 | <li>A human-readable name | ||
7004 | </li> | ||
7005 | <li>An informational description | ||
7006 | </li> | ||
7007 | <li>A reference to the particular section of this document that normatively defines the feature | ||
7008 | </li> | ||
7009 | <li>Whether the feature applies to the Client role, the Server | ||
7010 | role, or both (where "N/A" signifies that the feature is not | ||
7011 | applicable to the specified role) | ||
7012 | </li> | ||
7013 | <li>Whether the feature MUST or SHOULD be implemented, where the capitalized terms are to be understood as described in <a class='info' href='#KEYWORDS'>[KEYWORDS]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a> | ||
7014 | </li> | ||
7015 | </ul><p> | ||
7016 | |||
7017 | </p> | ||
7018 | <p>The feature set specified here attempts to adhere to the concepts and formats proposed by Larry Masinter within the IETF's NEWTRK Working Group in 2005, as captured in <a class='info' href='#INTEROP'>[INTEROP]<span> (</span><span class='info'>Masinter, L., “Formalizing IETF Interoperability Reporting,” October 2005.</span><span>)</span></a>. Although this feature set is more detailed than called for by <a class='info' href='#REPORTS'>[REPORTS]<span> (</span><span class='info'>Dusseault, L. and R. Sparks, “Guidance on Interoperation and Implementation Reports for Advancement to Draft Standard,” September 2009.</span><span>)</span></a>, it provides a suitable basis for the generation of implementation reports to be submitted in support of advancing this specification from Proposed Standard to Draft Standard in accordance with <a class='info' href='#PROCESS'>[PROCESS]<span> (</span><span class='info'>Bradner, S., “The Internet Standards Process -- Revision 3,” October 1996.</span><span>)</span></a>. | ||
7019 | </p> | ||
7020 | <p> | ||
7021 | </p> | ||
7022 | <blockquote class="text"><dl> | ||
7023 | <dt>Feature:</dt> | ||
7024 | <dd>bind-gen | ||
7025 | </dd> | ||
7026 | <dt>Description:</dt> | ||
7027 | <dd>Generate a random resource on demand. | ||
7028 | </dd> | ||
7029 | <dt>Section:</dt> | ||
7030 | <dd><a class='info' href='#bind-servergen'>Section 7.6<span> (</span><span class='info'>Server-Generated Resource Identifier</span><span>)</span></a> | ||
7031 | </dd> | ||
7032 | <dt>Roles:</dt> | ||
7033 | <dd>Client N/A, Server MUST. | ||
7034 | </dd> | ||
7035 | </dl></blockquote><p> | ||
7036 | |||
7037 | </p> | ||
7038 | <p> | ||
7039 | </p> | ||
7040 | <blockquote class="text"><dl> | ||
7041 | <dt>Feature:</dt> | ||
7042 | <dd>bind-mtn | ||
7043 | </dd> | ||
7044 | <dt>Description:</dt> | ||
7045 | <dd>Consider resource binding as mandatory-to-negotiate. | ||
7046 | </dd> | ||
7047 | <dt>Section:</dt> | ||
7048 | <dd><a class='info' href='#bind-rules-mtn'>Section 7.3.1<span> (</span><span class='info'>Mandatory-to-Negotiate</span><span>)</span></a> | ||
7049 | </dd> | ||
7050 | <dt>Roles:</dt> | ||
7051 | <dd>Client MUST, Server MUST. | ||
7052 | </dd> | ||
7053 | </dl></blockquote><p> | ||
7054 | |||
7055 | </p> | ||
7056 | <p> | ||
7057 | </p> | ||
7058 | <blockquote class="text"><dl> | ||
7059 | <dt>Feature:</dt> | ||
7060 | <dd>bind-restart | ||
7061 | </dd> | ||
7062 | <dt>Description:</dt> | ||
7063 | <dd>Do not restart the stream after negotiation of resource binding. | ||
7064 | </dd> | ||
7065 | <dt>Section:</dt> | ||
7066 | <dd><a class='info' href='#bind-rules-restart'>Section 7.3.2<span> (</span><span class='info'>Restart</span><span>)</span></a> | ||
7067 | </dd> | ||
7068 | <dt>Roles:</dt> | ||
7069 | <dd>Client MUST, Server MUST. | ||
7070 | </dd> | ||
7071 | </dl></blockquote><p> | ||
7072 | |||
7073 | </p> | ||
7074 | <p> | ||
7075 | </p> | ||
7076 | <blockquote class="text"><dl> | ||
7077 | <dt>Feature:</dt> | ||
7078 | <dd>bind-support | ||
7079 | </dd> | ||
7080 | <dt>Description:</dt> | ||
7081 | <dd>Support binding of client resources to an authenticated stream. | ||
7082 | </dd> | ||
7083 | <dt>Section:</dt> | ||
7084 | <dd><a class='info' href='#bind'>Section 7<span> (</span><span class='info'>Resource Binding</span><span>)</span></a> | ||
7085 | </dd> | ||
7086 | <dt>Roles:</dt> | ||
7087 | <dd>Client MUST, Server MUST. | ||
7088 | </dd> | ||
7089 | </dl></blockquote><p> | ||
7090 | |||
7091 | </p> | ||
7092 | <p> | ||
7093 | </p> | ||
7094 | <blockquote class="text"><dl> | ||
7095 | <dt>Feature:</dt> | ||
7096 | <dd>sasl-correlate | ||
7097 | </dd> | ||
7098 | <dt>Description:</dt> | ||
7099 | <dd>When authenticating a stream peer using SASL, correlate the authentication identifier resulting from SASL negotiation with the 'from' address (if any) of the stream header it received from the peer. | ||
7100 | </dd> | ||
7101 | <dt>Section:</dt> | ||
7102 | <dd><a class='info' href='#sasl-process-neg-success'>Section 6.4.6<span> (</span><span class='info'>SASL Success</span><span>)</span></a> | ||
7103 | </dd> | ||
7104 | <dt>Roles:</dt> | ||
7105 | <dd>Client SHOULD, Server SHOULD. | ||
7106 | </dd> | ||
7107 | </dl></blockquote><p> | ||
7108 | |||
7109 | </p> | ||
7110 | <p> | ||
7111 | </p> | ||
7112 | <blockquote class="text"><dl> | ||
7113 | <dt>Feature:</dt> | ||
7114 | <dd>sasl-errors | ||
7115 | </dd> | ||
7116 | <dt>Description:</dt> | ||
7117 | <dd>Support SASL errors during the negotiation process. | ||
7118 | </dd> | ||
7119 | <dt>Section:</dt> | ||
7120 | <dd><a class='info' href='#sasl-errors'>Section 6.5<span> (</span><span class='info'>SASL Errors</span><span>)</span></a> | ||
7121 | </dd> | ||
7122 | <dt>Roles:</dt> | ||
7123 | <dd>Client MUST, Server MUST. | ||
7124 | </dd> | ||
7125 | </dl></blockquote><p> | ||
7126 | |||
7127 | </p> | ||
7128 | <p> | ||
7129 | </p> | ||
7130 | <blockquote class="text"><dl> | ||
7131 | <dt>Feature:</dt> | ||
7132 | <dd>sasl-mtn | ||
7133 | </dd> | ||
7134 | <dt>Description:</dt> | ||
7135 | <dd>Consider SASL as mandatory-to-negotiate. | ||
7136 | </dd> | ||
7137 | <dt>Section:</dt> | ||
7138 | <dd><a class='info' href='#sasl-rules-mtn'>Section 6.3.1<span> (</span><span class='info'>Mandatory-to-Negotiate</span><span>)</span></a> | ||
7139 | </dd> | ||
7140 | <dt>Roles:</dt> | ||
7141 | <dd>Client MUST, Server MUST. | ||
7142 | </dd> | ||
7143 | </dl></blockquote><p> | ||
7144 | |||
7145 | </p> | ||
7146 | <p> | ||
7147 | </p> | ||
7148 | <blockquote class="text"><dl> | ||
7149 | <dt>Feature:</dt> | ||
7150 | <dd>sasl-restart | ||
7151 | </dd> | ||
7152 | <dt>Description:</dt> | ||
7153 | <dd>Initiate or handle a stream restart after SASL negotiation. | ||
7154 | </dd> | ||
7155 | <dt>Section:</dt> | ||
7156 | <dd><a class='info' href='#sasl-rules-restart'>Section 6.3.2<span> (</span><span class='info'>Restart</span><span>)</span></a> | ||
7157 | </dd> | ||
7158 | <dt>Roles:</dt> | ||
7159 | <dd>Client MUST, Server MUST. | ||
7160 | </dd> | ||
7161 | </dl></blockquote><p> | ||
7162 | |||
7163 | </p> | ||
7164 | <p> | ||
7165 | </p> | ||
7166 | <blockquote class="text"><dl> | ||
7167 | <dt>Feature:</dt> | ||
7168 | <dd>sasl-support | ||
7169 | </dd> | ||
7170 | <dt>Description:</dt> | ||
7171 | <dd>Support the Simple Authentication and Security Layer for stream authentication. | ||
7172 | </dd> | ||
7173 | <dt>Section:</dt> | ||
7174 | <dd><a class='info' href='#sasl'>Section 6<span> (</span><span class='info'>SASL Negotiation</span><span>)</span></a> | ||
7175 | </dd> | ||
7176 | <dt>Roles:</dt> | ||
7177 | <dd>Client MUST, Server MUST. | ||
7178 | </dd> | ||
7179 | </dl></blockquote><p> | ||
7180 | |||
7181 | </p> | ||
7182 | <p> | ||
7183 | </p> | ||
7184 | <blockquote class="text"><dl> | ||
7185 | <dt>Feature:</dt> | ||
7186 | <dd>security-mti-auth-scram | ||
7187 | </dd> | ||
7188 | <dt>Description:</dt> | ||
7189 | <dd>Support the SASL SCRAM mechanism for authentication only (this implies support for both the SCRAM‑SHA‑1 and SCRAM‑SHA‑1‑PLUS variants). | ||
7190 | </dd> | ||
7191 | <dt>Section:</dt> | ||
7192 | <dd><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> | ||
7193 | </dd> | ||
7194 | <dt>Roles:</dt> | ||
7195 | <dd>Client MUST, Server MUST. | ||
7196 | </dd> | ||
7197 | </dl></blockquote><p> | ||
7198 | |||
7199 | </p> | ||
7200 | <p> | ||
7201 | </p> | ||
7202 | <blockquote class="text"><dl> | ||
7203 | <dt>Feature:</dt> | ||
7204 | <dd>security-mti-both-external | ||
7205 | </dd> | ||
7206 | <dt>Description:</dt> | ||
7207 | <dd>Support TLS with SASL EXTERNAL for confidentiality and authentication. | ||
7208 | </dd> | ||
7209 | <dt>Section:</dt> | ||
7210 | <dd><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> | ||
7211 | </dd> | ||
7212 | <dt>Roles:</dt> | ||
7213 | <dd>Client SHOULD, Server MUST. | ||
7214 | </dd> | ||
7215 | </dl></blockquote><p> | ||
7216 | |||
7217 | </p> | ||
7218 | <p> | ||
7219 | </p> | ||
7220 | <blockquote class="text"><dl> | ||
7221 | <dt>Feature:</dt> | ||
7222 | <dd>security-mti-both-plain | ||
7223 | </dd> | ||
7224 | <dt>Description:</dt> | ||
7225 | <dd>Support TLS using the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite plus the SASL PLAIN mechanism for confidentiality and authentication. | ||
7226 | </dd> | ||
7227 | <dt>Section:</dt> | ||
7228 | <dd><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> | ||
7229 | </dd> | ||
7230 | <dt>Roles:</dt> | ||
7231 | <dd>Client SHOULD, Server MAY. | ||
7232 | </dd> | ||
7233 | </dl></blockquote><p> | ||
7234 | |||
7235 | </p> | ||
7236 | <p> | ||
7237 | </p> | ||
7238 | <blockquote class="text"><dl> | ||
7239 | <dt>Feature:</dt> | ||
7240 | <dd>security-mti-both-scram | ||
7241 | </dd> | ||
7242 | <dt>Description:</dt> | ||
7243 | <dd>Support TLS using the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite plus the SCRAM-SHA-1 and SCRAM-SHA-1-PLUS variants of the SASL SCRAM mechanism for confidentiality and authentication. | ||
7244 | </dd> | ||
7245 | <dt>Section:</dt> | ||
7246 | <dd><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> | ||
7247 | </dd> | ||
7248 | <dt>Roles:</dt> | ||
7249 | <dd>Client MUST, Server MUST. | ||
7250 | </dd> | ||
7251 | </dl></blockquote><p> | ||
7252 | |||
7253 | </p> | ||
7254 | <p> | ||
7255 | </p> | ||
7256 | <blockquote class="text"><dl> | ||
7257 | <dt>Feature:</dt> | ||
7258 | <dd>security-mti-confidentiality | ||
7259 | </dd> | ||
7260 | <dt>Description:</dt> | ||
7261 | <dd>Support TLS using the TLS_RSA_WITH_AES_128_CBC_SHA ciphersuite for confidentiality only. | ||
7262 | </dd> | ||
7263 | <dt>Section:</dt> | ||
7264 | <dd><a class='info' href='#security-mti'>Section 13.8<span> (</span><span class='info'>Mandatory-to-Implement TLS and SASL Technologies</span><span>)</span></a> | ||
7265 | </dd> | ||
7266 | <dt>Roles:</dt> | ||
7267 | <dd>Client N/A, Server SHOULD. | ||
7268 | </dd> | ||
7269 | </dl></blockquote><p> | ||
7270 | |||
7271 | </p> | ||
7272 | <p> | ||
7273 | </p> | ||
7274 | <blockquote class="text"><dl> | ||
7275 | <dt>Feature:</dt> | ||
7276 | <dd>stanza-attribute-from | ||
7277 | </dd> | ||
7278 | <dt>Description:</dt> | ||
7279 | <dd>Support the common 'from' attribute for all stanza kinds. | ||
7280 | </dd> | ||
7281 | <dt>Section:</dt> | ||
7282 | <dd><a class='info' href='#stanzas-attributes-from'>Section 8.1.2<span> (</span><span class='info'>from</span><span>)</span></a> | ||
7283 | </dd> | ||
7284 | <dt>Roles:</dt> | ||
7285 | <dd>Client MUST, Server MUST. | ||
7286 | </dd> | ||
7287 | </dl></blockquote><p> | ||
7288 | |||
7289 | </p> | ||
7290 | <p> | ||
7291 | </p> | ||
7292 | <blockquote class="text"><dl> | ||
7293 | <dt>Feature:</dt> | ||
7294 | <dd>stanza-attribute-from-stamp | ||
7295 | </dd> | ||
7296 | <dt>Description:</dt> | ||
7297 | <dd>Stamp or rewrite the 'from' address of all stanzas received from connected clients. | ||
7298 | </dd> | ||
7299 | <dt>Section:</dt> | ||
7300 | <dd><a class='info' href='#stanzas-attributes-from-c2s'>Section 8.1.2.1<span> (</span><span class='info'>Client-to-Server Streams</span><span>)</span></a> | ||
7301 | </dd> | ||
7302 | <dt>Roles:</dt> | ||
7303 | <dd>Client N/A, Server MUST. | ||
7304 | </dd> | ||
7305 | </dl></blockquote><p> | ||
7306 | |||
7307 | </p> | ||
7308 | <p> | ||
7309 | </p> | ||
7310 | <blockquote class="text"><dl> | ||
7311 | <dt>Feature:</dt> | ||
7312 | <dd>stanza-attribute-from-validate | ||
7313 | </dd> | ||
7314 | <dt>Description:</dt> | ||
7315 | <dd>Validate the 'from' address of all stanzas received from peer servers. | ||
7316 | </dd> | ||
7317 | <dt>Section:</dt> | ||
7318 | <dd><a class='info' href='#stanzas-attributes-from-s2s'>Section 8.1.2.2<span> (</span><span class='info'>Server-to-Server Streams</span><span>)</span></a> | ||
7319 | </dd> | ||
7320 | <dt>Roles:</dt> | ||
7321 | <dd>Client N/A, Server MUST. | ||
7322 | </dd> | ||
7323 | </dl></blockquote><p> | ||
7324 | |||
7325 | </p> | ||
7326 | <p> | ||
7327 | </p> | ||
7328 | <blockquote class="text"><dl> | ||
7329 | <dt>Feature:</dt> | ||
7330 | <dd>stanza-attribute-id | ||
7331 | </dd> | ||
7332 | <dt>Description:</dt> | ||
7333 | <dd>Support the common 'id' attribute for all stanza kinds. | ||
7334 | </dd> | ||
7335 | <dt>Section:</dt> | ||
7336 | <dd><a class='info' href='#stanzas-attributes-id'>Section 8.1.3<span> (</span><span class='info'>id</span><span>)</span></a> | ||
7337 | </dd> | ||
7338 | <dt>Roles:</dt> | ||
7339 | <dd>Client MUST, Server MUST. | ||
7340 | </dd> | ||
7341 | </dl></blockquote><p> | ||
7342 | |||
7343 | </p> | ||
7344 | <p> | ||
7345 | </p> | ||
7346 | <blockquote class="text"><dl> | ||
7347 | <dt>Feature:</dt> | ||
7348 | <dd>stanza-attribute-to | ||
7349 | </dd> | ||
7350 | <dt>Description:</dt> | ||
7351 | <dd>Support the common 'to' attribute for all stanza kinds. | ||
7352 | </dd> | ||
7353 | <dt>Section:</dt> | ||
7354 | <dd><a class='info' href='#stanzas-attributes-to'>Section 8.1.1<span> (</span><span class='info'>to</span><span>)</span></a> | ||
7355 | </dd> | ||
7356 | <dt>Roles:</dt> | ||
7357 | <dd>Client MUST, Server MUST. | ||
7358 | </dd> | ||
7359 | </dl></blockquote><p> | ||
7360 | |||
7361 | </p> | ||
7362 | <p> | ||
7363 | </p> | ||
7364 | <blockquote class="text"><dl> | ||
7365 | <dt>Feature:</dt> | ||
7366 | <dd>stanza-attribute-to-validate | ||
7367 | </dd> | ||
7368 | <dt>Description:</dt> | ||
7369 | <dd>Ensure that all stanzas received from peer servers include a 'to' address. | ||
7370 | </dd> | ||
7371 | <dt>Section:</dt> | ||
7372 | <dd><a class='info' href='#stanzas-attributes-to'>Section 8.1.1<span> (</span><span class='info'>to</span><span>)</span></a> | ||
7373 | </dd> | ||
7374 | <dt>Roles:</dt> | ||
7375 | <dd>Client N/A, Server MUST. | ||
7376 | </dd> | ||
7377 | </dl></blockquote><p> | ||
7378 | |||
7379 | </p> | ||
7380 | <p> | ||
7381 | </p> | ||
7382 | <blockquote class="text"><dl> | ||
7383 | <dt>Feature:</dt> | ||
7384 | <dd>stanza-attribute-type | ||
7385 | </dd> | ||
7386 | <dt>Description:</dt> | ||
7387 | <dd>Support the common 'type' attribute for all stanza kinds. | ||
7388 | </dd> | ||
7389 | <dt>Section:</dt> | ||
7390 | <dd><a class='info' href='#stanzas-attributes-type'>Section 8.1.4<span> (</span><span class='info'>type</span><span>)</span></a> | ||
7391 | </dd> | ||
7392 | <dt>Roles:</dt> | ||
7393 | <dd>Client MUST, Server MUST. | ||
7394 | </dd> | ||
7395 | </dl></blockquote><p> | ||
7396 | |||
7397 | </p> | ||
7398 | <p> | ||
7399 | </p> | ||
7400 | <blockquote class="text"><dl> | ||
7401 | <dt>Feature:</dt> | ||
7402 | <dd>stanza-attribute-xmllang | ||
7403 | </dd> | ||
7404 | <dt>Description:</dt> | ||
7405 | <dd>Support the common 'xml:lang' attribute for all stanza kinds. | ||
7406 | </dd> | ||
7407 | <dt>Section:</dt> | ||
7408 | <dd><a class='info' href='#stanzas-attributes-lang'>Section 8.1.5<span> (</span><span class='info'>xml:lang</span><span>)</span></a> | ||
7409 | </dd> | ||
7410 | <dt>Roles:</dt> | ||
7411 | <dd>Client MUST, Server MUST. | ||
7412 | </dd> | ||
7413 | </dl></blockquote><p> | ||
7414 | |||
7415 | </p> | ||
7416 | <p> | ||
7417 | </p> | ||
7418 | <blockquote class="text"><dl> | ||
7419 | <dt>Feature:</dt> | ||
7420 | <dd>stanza-error | ||
7421 | </dd> | ||
7422 | <dt>Description:</dt> | ||
7423 | <dd>Generate and handle stanzas of type "error" for all stanza kinds. | ||
7424 | </dd> | ||
7425 | <dt>Section:</dt> | ||
7426 | <dd><a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a> | ||
7427 | </dd> | ||
7428 | <dt>Roles:</dt> | ||
7429 | <dd>Client MUST, Server MUST. | ||
7430 | </dd> | ||
7431 | </dl></blockquote><p> | ||
7432 | |||
7433 | </p> | ||
7434 | <p> | ||
7435 | </p> | ||
7436 | <blockquote class="text"><dl> | ||
7437 | <dt>Feature:</dt> | ||
7438 | <dd>stanza-error-child | ||
7439 | </dd> | ||
7440 | <dt>Description:</dt> | ||
7441 | <dd>Ensure that stanzas of type "error" include an <error/> child element. | ||
7442 | </dd> | ||
7443 | <dt>Section:</dt> | ||
7444 | <dd><a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a> | ||
7445 | </dd> | ||
7446 | <dt>Roles:</dt> | ||
7447 | <dd>Client MUST, Server MUST. | ||
7448 | </dd> | ||
7449 | </dl></blockquote><p> | ||
7450 | |||
7451 | </p> | ||
7452 | <p> | ||
7453 | </p> | ||
7454 | <blockquote class="text"><dl> | ||
7455 | <dt>Feature:</dt> | ||
7456 | <dd>stanza-error-id | ||
7457 | </dd> | ||
7458 | <dt>Description:</dt> | ||
7459 | <dd>Ensure that stanzas of type "error" preserve the 'id' provided in the triggering stanza. | ||
7460 | </dd> | ||
7461 | <dt>Section:</dt> | ||
7462 | <dd><a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a> | ||
7463 | </dd> | ||
7464 | <dt>Roles:</dt> | ||
7465 | <dd>Client MUST, Server MUST. | ||
7466 | </dd> | ||
7467 | </dl></blockquote><p> | ||
7468 | |||
7469 | </p> | ||
7470 | <p> | ||
7471 | </p> | ||
7472 | <blockquote class="text"><dl> | ||
7473 | <dt>Feature:</dt> | ||
7474 | <dd>stanza-error-reply | ||
7475 | </dd> | ||
7476 | <dt>Description:</dt> | ||
7477 | <dd>Do not reply to a stanza of type "error" with another stanza of type "error". | ||
7478 | </dd> | ||
7479 | <dt>Section:</dt> | ||
7480 | <dd><a class='info' href='#stanzas-error'>Section 8.3<span> (</span><span class='info'>Stanza Errors</span><span>)</span></a> | ||
7481 | </dd> | ||
7482 | <dt>Roles:</dt> | ||
7483 | <dd>Client MUST, Server MUST. | ||
7484 | </dd> | ||
7485 | </dl></blockquote><p> | ||
7486 | |||
7487 | </p> | ||
7488 | <p> | ||
7489 | </p> | ||
7490 | <blockquote class="text"><dl> | ||
7491 | <dt>Feature:</dt> | ||
7492 | <dd>stanza-extension | ||
7493 | </dd> | ||
7494 | <dt>Description:</dt> | ||
7495 | <dd>Correctly process XML data qualified by an unsupported XML namespace, where "correctly process" means to ignore that portion of the stanza in the case of a message or presence stanza and return an error in the case of an IQ stanza (for the intended recipient), and to route or deliver the stanza (for a routing entity such as a server). | ||
7496 | </dd> | ||
7497 | <dt>Section:</dt> | ||
7498 | <dd><a class='info' href='#stanzas-extended'>Section 8.4<span> (</span><span class='info'>Extended Content</span><span>)</span></a> | ||
7499 | </dd> | ||
7500 | <dt>Roles:</dt> | ||
7501 | <dd>Client MUST, Server MUST. | ||
7502 | </dd> | ||
7503 | </dl></blockquote><p> | ||
7504 | |||
7505 | </p> | ||
7506 | <p> | ||
7507 | </p> | ||
7508 | <blockquote class="text"><dl> | ||
7509 | <dt>Feature:</dt> | ||
7510 | <dd>stanza-iq-child | ||
7511 | </dd> | ||
7512 | <dt>Description:</dt> | ||
7513 | <dd>Include exactly one child element in an <iq/> stanza of type "get" or "set", zero or one child elements in an <iq/> stanza of type "result", and one or two child elements in an <iq/> stanza of type "error". | ||
7514 | </dd> | ||
7515 | <dt>Section:</dt> | ||
7516 | <dd><a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a> | ||
7517 | </dd> | ||
7518 | <dt>Roles:</dt> | ||
7519 | <dd>Client MUST, Server MUST. | ||
7520 | </dd> | ||
7521 | </dl></blockquote><p> | ||
7522 | |||
7523 | </p> | ||
7524 | <p> | ||
7525 | </p> | ||
7526 | <blockquote class="text"><dl> | ||
7527 | <dt>Feature:</dt> | ||
7528 | <dd>stanza-iq-id | ||
7529 | </dd> | ||
7530 | <dt>Description:</dt> | ||
7531 | <dd>Ensure that all <iq/> stanzas include an 'id' attribute. | ||
7532 | </dd> | ||
7533 | <dt>Section:</dt> | ||
7534 | <dd><a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a> | ||
7535 | </dd> | ||
7536 | <dt>Roles:</dt> | ||
7537 | <dd>Client MUST, Server MUST. | ||
7538 | </dd> | ||
7539 | </dl></blockquote><p> | ||
7540 | |||
7541 | </p> | ||
7542 | <p> | ||
7543 | </p> | ||
7544 | <blockquote class="text"><dl> | ||
7545 | <dt>Feature:</dt> | ||
7546 | <dd>stanza-iq-reply | ||
7547 | </dd> | ||
7548 | <dt>Description:</dt> | ||
7549 | <dd>Reply to an <iq/> stanza of type "get" or "set" with an <iq/> stanza of type "result" or "error". | ||
7550 | </dd> | ||
7551 | <dt>Section:</dt> | ||
7552 | <dd><a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a> | ||
7553 | </dd> | ||
7554 | <dt>Roles:</dt> | ||
7555 | <dd>Client MUST, Server MUST. | ||
7556 | </dd> | ||
7557 | </dl></blockquote><p> | ||
7558 | |||
7559 | </p> | ||
7560 | <p> | ||
7561 | </p> | ||
7562 | <blockquote class="text"><dl> | ||
7563 | <dt>Feature:</dt> | ||
7564 | <dd>stanza-iq-type | ||
7565 | </dd> | ||
7566 | <dt>Description:</dt> | ||
7567 | <dd>Ensure that all <iq/> stanzas include a 'type' attribute whose value is "get", "set", "result", or "error". | ||
7568 | </dd> | ||
7569 | <dt>Section:</dt> | ||
7570 | <dd><a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a> | ||
7571 | </dd> | ||
7572 | <dt>Roles:</dt> | ||
7573 | <dd>Client MUST, Server MUST. | ||
7574 | </dd> | ||
7575 | </dl></blockquote><p> | ||
7576 | |||
7577 | </p> | ||
7578 | <p> | ||
7579 | </p> | ||
7580 | <blockquote class="text"><dl> | ||
7581 | <dt>Feature:</dt> | ||
7582 | <dd>stanza-kind-iq | ||
7583 | </dd> | ||
7584 | <dt>Description:</dt> | ||
7585 | <dd>Support the <iq/> stanza. | ||
7586 | </dd> | ||
7587 | <dt>Section:</dt> | ||
7588 | <dd><a class='info' href='#stanzas-semantics-iq'>Section 8.2.3<span> (</span><span class='info'>IQ Semantics</span><span>)</span></a> | ||
7589 | </dd> | ||
7590 | <dt>Roles:</dt> | ||
7591 | <dd>Client MUST, Server MUST. | ||
7592 | </dd> | ||
7593 | </dl></blockquote><p> | ||
7594 | |||
7595 | </p> | ||
7596 | <p> | ||
7597 | </p> | ||
7598 | <blockquote class="text"><dl> | ||
7599 | <dt>Feature:</dt> | ||
7600 | <dd>stanza-kind-message | ||
7601 | </dd> | ||
7602 | <dt>Description:</dt> | ||
7603 | <dd>Support the <message/> stanza. | ||
7604 | </dd> | ||
7605 | <dt>Section:</dt> | ||
7606 | <dd><a class='info' href='#stanzas-semantics-message'>Section 8.2.1<span> (</span><span class='info'>Message Semantics</span><span>)</span></a> | ||
7607 | </dd> | ||
7608 | <dt>Roles:</dt> | ||
7609 | <dd>Client MUST, Server MUST. | ||
7610 | </dd> | ||
7611 | </dl></blockquote><p> | ||
7612 | |||
7613 | </p> | ||
7614 | <p> | ||
7615 | </p> | ||
7616 | <blockquote class="text"><dl> | ||
7617 | <dt>Feature:</dt> | ||
7618 | <dd>stanza-kind-presence | ||
7619 | </dd> | ||
7620 | <dt>Description:</dt> | ||
7621 | <dd>Support the <presence/> stanza. | ||
7622 | </dd> | ||
7623 | <dt>Section:</dt> | ||
7624 | <dd><a class='info' href='#stanzas-semantics-presence'>Section 8.2.2<span> (</span><span class='info'>Presence Semantics</span><span>)</span></a> | ||
7625 | </dd> | ||
7626 | <dt>Roles:</dt> | ||
7627 | <dd>Client MUST, Server MUST. | ||
7628 | </dd> | ||
7629 | </dl></blockquote><p> | ||
7630 | |||
7631 | </p> | ||
7632 | <p> | ||
7633 | </p> | ||
7634 | <blockquote class="text"><dl> | ||
7635 | <dt>Feature:</dt> | ||
7636 | <dd>stream-attribute-initial-from | ||
7637 | </dd> | ||
7638 | <dt>Description:</dt> | ||
7639 | <dd>Include a 'from' attribute in the initial stream header. | ||
7640 | </dd> | ||
7641 | <dt>Section:</dt> | ||
7642 | <dd><a class='info' href='#streams-attr-from'>Section 4.7.1<span> (</span><span class='info'>from</span><span>)</span></a> | ||
7643 | </dd> | ||
7644 | <dt>Roles:</dt> | ||
7645 | <dd>Client SHOULD, Server MUST. | ||
7646 | </dd> | ||
7647 | </dl></blockquote><p> | ||
7648 | |||
7649 | </p> | ||
7650 | <p> | ||
7651 | </p> | ||
7652 | <blockquote class="text"><dl> | ||
7653 | <dt>Feature:</dt> | ||
7654 | <dd>stream-attribute-initial-lang | ||
7655 | </dd> | ||
7656 | <dt>Description:</dt> | ||
7657 | <dd>Include an 'xml:lang' attribute in the initial stream header. | ||
7658 | </dd> | ||
7659 | <dt>Section:</dt> | ||
7660 | <dd><a class='info' href='#streams-attr-xmllang'>Section 4.7.4<span> (</span><span class='info'>xml:lang</span><span>)</span></a> | ||
7661 | </dd> | ||
7662 | <dt>Roles:</dt> | ||
7663 | <dd>Client SHOULD, Server SHOULD. | ||
7664 | </dd> | ||
7665 | </dl></blockquote><p> | ||
7666 | |||
7667 | </p> | ||
7668 | <p> | ||
7669 | </p> | ||
7670 | <blockquote class="text"><dl> | ||
7671 | <dt>Feature:</dt> | ||
7672 | <dd>stream-attribute-initial-to | ||
7673 | </dd> | ||
7674 | <dt>Description:</dt> | ||
7675 | <dd>Include a 'to' attribute in the initial stream header. | ||
7676 | </dd> | ||
7677 | <dt>Section:</dt> | ||
7678 | <dd><a class='info' href='#streams-attr-to'>Section 4.7.2<span> (</span><span class='info'>to</span><span>)</span></a> | ||
7679 | </dd> | ||
7680 | <dt>Roles:</dt> | ||
7681 | <dd>Client MUST, Server MUST. | ||
7682 | </dd> | ||
7683 | </dl></blockquote><p> | ||
7684 | |||
7685 | </p> | ||
7686 | <p> | ||
7687 | </p> | ||
7688 | <blockquote class="text"><dl> | ||
7689 | <dt>Feature:</dt> | ||
7690 | <dd>stream-attribute-response-from | ||
7691 | </dd> | ||
7692 | <dt>Description:</dt> | ||
7693 | <dd>Include a 'from' attribute in the response stream header. | ||
7694 | </dd> | ||
7695 | <dt>Section:</dt> | ||
7696 | <dd><a class='info' href='#streams-attr-from'>Section 4.7.1<span> (</span><span class='info'>from</span><span>)</span></a> | ||
7697 | </dd> | ||
7698 | <dt>Roles:</dt> | ||
7699 | <dd>Client N/A, Server MUST. | ||
7700 | </dd> | ||
7701 | </dl></blockquote><p> | ||
7702 | |||
7703 | </p> | ||
7704 | <p> | ||
7705 | </p> | ||
7706 | <blockquote class="text"><dl> | ||
7707 | <dt>Feature:</dt> | ||
7708 | <dd>stream-attribute-response-id | ||
7709 | </dd> | ||
7710 | <dt>Description:</dt> | ||
7711 | <dd>Include an 'id' attribute in the response stream header. | ||
7712 | </dd> | ||
7713 | <dt>Section:</dt> | ||
7714 | <dd><a class='info' href='#streams-attr-id'>Section 4.7.3<span> (</span><span class='info'>id</span><span>)</span></a> | ||
7715 | </dd> | ||
7716 | <dt>Roles:</dt> | ||
7717 | <dd>Client N/A, Server MUST. | ||
7718 | </dd> | ||
7719 | </dl></blockquote><p> | ||
7720 | |||
7721 | </p> | ||
7722 | <p> | ||
7723 | </p> | ||
7724 | <blockquote class="text"><dl> | ||
7725 | <dt>Feature:</dt> | ||
7726 | <dd>stream-attribute-response-id-unique | ||
7727 | </dd> | ||
7728 | <dt>Description:</dt> | ||
7729 | <dd>Ensure that the 'id' attribute in the response stream header is unique within the context of the receiving entity. | ||
7730 | </dd> | ||
7731 | <dt>Section:</dt> | ||
7732 | <dd><a class='info' href='#streams-attr-id'>Section 4.7.3<span> (</span><span class='info'>id</span><span>)</span></a> | ||
7733 | </dd> | ||
7734 | <dt>Roles:</dt> | ||
7735 | <dd>Client N/A, Server MUST. | ||
7736 | </dd> | ||
7737 | </dl></blockquote><p> | ||
7738 | |||
7739 | </p> | ||
7740 | <p> | ||
7741 | </p> | ||
7742 | <blockquote class="text"><dl> | ||
7743 | <dt>Feature:</dt> | ||
7744 | <dd>stream-attribute-response-to | ||
7745 | </dd> | ||
7746 | <dt>Description:</dt> | ||
7747 | <dd>Include a 'to' attribute in the response stream header. | ||
7748 | </dd> | ||
7749 | <dt>Section:</dt> | ||
7750 | <dd><a class='info' href='#streams-attr-to'>Section 4.7.2<span> (</span><span class='info'>to</span><span>)</span></a> | ||
7751 | </dd> | ||
7752 | <dt>Roles:</dt> | ||
7753 | <dd>Client N/A, Server SHOULD. | ||
7754 | </dd> | ||
7755 | </dl></blockquote><p> | ||
7756 | |||
7757 | </p> | ||
7758 | <p> | ||
7759 | </p> | ||
7760 | <blockquote class="text"><dl> | ||
7761 | <dt>Feature:</dt> | ||
7762 | <dd>stream-error-generate | ||
7763 | </dd> | ||
7764 | <dt>Description:</dt> | ||
7765 | <dd>Generate a stream error (followed by a closing stream tag and termination of the TCP connection) upon detecting a stream-related error condition. | ||
7766 | </dd> | ||
7767 | <dt>Section:</dt> | ||
7768 | <dd><a class='info' href='#streams-error'>Section 4.9<span> (</span><span class='info'>Stream Errors</span><span>)</span></a> | ||
7769 | </dd> | ||
7770 | <dt>Roles:</dt> | ||
7771 | <dd>Client MUST, Server MUST. | ||
7772 | </dd> | ||
7773 | </dl></blockquote><p> | ||
7774 | |||
7775 | </p> | ||
7776 | <p> | ||
7777 | </p> | ||
7778 | <blockquote class="text"><dl> | ||
7779 | <dt>Feature:</dt> | ||
7780 | <dd>stream-fqdn-resolution | ||
7781 | </dd> | ||
7782 | <dt>Description:</dt> | ||
7783 | <dd>Resolve FQDNs before opening a TCP connection to the receiving entity. | ||
7784 | </dd> | ||
7785 | <dt>Section:</dt> | ||
7786 | <dd><a class='info' href='#tcp-resolution'>Section 3.2<span> (</span><span class='info'>Resolution of Fully Qualified Domain Names</span><span>)</span></a> | ||
7787 | </dd> | ||
7788 | <dt>Roles:</dt> | ||
7789 | <dd>Client MUST, Server MUST. | ||
7790 | </dd> | ||
7791 | </dl></blockquote><p> | ||
7792 | |||
7793 | </p> | ||
7794 | <p> | ||
7795 | </p> | ||
7796 | <blockquote class="text"><dl> | ||
7797 | <dt>Feature:</dt> | ||
7798 | <dd>stream-negotiation-complete | ||
7799 | </dd> | ||
7800 | <dt>Description:</dt> | ||
7801 | <dd>Do not consider the stream negotiation process to be complete until the receiving entity sends a stream features advertisement that is empty or that contains only voluntary-to-negotiate features. | ||
7802 | </dd> | ||
7803 | <dt>Section:</dt> | ||
7804 | <dd><a class='info' href='#streams-negotiation-complete'>Section 4.3.5<span> (</span><span class='info'>Completion of Stream Negotiation</span><span>)</span></a> | ||
7805 | </dd> | ||
7806 | <dt>Roles:</dt> | ||
7807 | <dd>Client MUST, Server MUST. | ||
7808 | </dd> | ||
7809 | </dl></blockquote><p> | ||
7810 | |||
7811 | </p> | ||
7812 | <p> | ||
7813 | </p> | ||
7814 | <blockquote class="text"><dl> | ||
7815 | <dt>Feature:</dt> | ||
7816 | <dd>stream-negotiation-features | ||
7817 | </dd> | ||
7818 | <dt>Description:</dt> | ||
7819 | <dd>Send stream features after sending a response stream header. | ||
7820 | </dd> | ||
7821 | <dt>Section:</dt> | ||
7822 | <dd><a class='info' href='#streams-negotiation-features'>Section 4.3.2<span> (</span><span class='info'>Stream Features Format</span><span>)</span></a> | ||
7823 | </dd> | ||
7824 | <dt>Roles:</dt> | ||
7825 | <dd>Client N/A, Server MUST. | ||
7826 | </dd> | ||
7827 | </dl></blockquote><p> | ||
7828 | |||
7829 | </p> | ||
7830 | <p> | ||
7831 | </p> | ||
7832 | <blockquote class="text"><dl> | ||
7833 | <dt>Feature:</dt> | ||
7834 | <dd>stream-negotiation-restart | ||
7835 | </dd> | ||
7836 | <dt>Description:</dt> | ||
7837 | <dd>Consider the previous stream to be replaced upon negotiation of a stream feature that necessitates a stream restart, and send or receive a new initial stream header after negotiation of such a stream feature. | ||
7838 | </dd> | ||
7839 | <dt>Section:</dt> | ||
7840 | <dd><a class='info' href='#streams-negotiation-restart'>Section 4.3.3<span> (</span><span class='info'>Restarts</span><span>)</span></a> | ||
7841 | </dd> | ||
7842 | <dt>Roles:</dt> | ||
7843 | <dd>Client MUST, Server MUST. | ||
7844 | </dd> | ||
7845 | </dl></blockquote><p> | ||
7846 | |||
7847 | </p> | ||
7848 | <p> | ||
7849 | </p> | ||
7850 | <blockquote class="text"><dl> | ||
7851 | <dt>Feature:</dt> | ||
7852 | <dd>stream-reconnect | ||
7853 | </dd> | ||
7854 | <dt>Description:</dt> | ||
7855 | <dd>Reconnect with exponential backoff if a TCP connection is terminated unexpectedly. | ||
7856 | </dd> | ||
7857 | <dt>Section:</dt> | ||
7858 | <dd><a class='info' href='#tcp-reconnect'>Section 3.3<span> (</span><span class='info'>Reconnection</span><span>)</span></a> | ||
7859 | </dd> | ||
7860 | <dt>Roles:</dt> | ||
7861 | <dd>Client MUST, Server MUST. | ||
7862 | </dd> | ||
7863 | </dl></blockquote><p> | ||
7864 | |||
7865 | </p> | ||
7866 | <p> | ||
7867 | </p> | ||
7868 | <blockquote class="text"><dl> | ||
7869 | <dt>Feature:</dt> | ||
7870 | <dd>stream-tcp-binding | ||
7871 | </dd> | ||
7872 | <dt>Description:</dt> | ||
7873 | <dd>Bind an XML stream to a TCP connection. | ||
7874 | </dd> | ||
7875 | <dt>Section:</dt> | ||
7876 | <dd><a class='info' href='#tcp'>Section 3<span> (</span><span class='info'>TCP Binding</span><span>)</span></a> | ||
7877 | </dd> | ||
7878 | <dt>Roles:</dt> | ||
7879 | <dd>Client MUST, Server MUST. | ||
7880 | </dd> | ||
7881 | </dl></blockquote><p> | ||
7882 | |||
7883 | </p> | ||
7884 | <p> | ||
7885 | </p> | ||
7886 | <blockquote class="text"><dl> | ||
7887 | <dt>Feature:</dt> | ||
7888 | <dd>tls-certs | ||
7889 | </dd> | ||
7890 | <dt>Description:</dt> | ||
7891 | <dd>Check the identity specified in a certificate that is presented during TLS negotiation. | ||
7892 | </dd> | ||
7893 | <dt>Section:</dt> | ||
7894 | <dd><a class='info' href='#security-certificates-validation'>Section 13.7.2<span> (</span><span class='info'>Certificate Validation</span><span>)</span></a> | ||
7895 | </dd> | ||
7896 | <dt>Roles:</dt> | ||
7897 | <dd>Client MUST, Server MUST. | ||
7898 | </dd> | ||
7899 | </dl></blockquote><p> | ||
7900 | |||
7901 | </p> | ||
7902 | <p> | ||
7903 | </p> | ||
7904 | <blockquote class="text"><dl> | ||
7905 | <dt>Feature:</dt> | ||
7906 | <dd>tls-mtn | ||
7907 | </dd> | ||
7908 | <dt>Description:</dt> | ||
7909 | <dd>Consider TLS as mandatory-to-negotiate if STARTTLS is the only feature advertised or if the STARTTLS feature advertisement includes an empty <required/> element. | ||
7910 | </dd> | ||
7911 | <dt>Section:</dt> | ||
7912 | <dd><a class='info' href='#tls-rules-mtn'>Section 5.3.1<span> (</span><span class='info'>Mandatory-to-Negotiate</span><span>)</span></a> | ||
7913 | </dd> | ||
7914 | <dt>Roles:</dt> | ||
7915 | <dd>Client MUST, Server MUST. | ||
7916 | </dd> | ||
7917 | </dl></blockquote><p> | ||
7918 | |||
7919 | </p> | ||
7920 | <p> | ||
7921 | </p> | ||
7922 | <blockquote class="text"><dl> | ||
7923 | <dt>Feature:</dt> | ||
7924 | <dd>tls-restart | ||
7925 | </dd> | ||
7926 | <dt>Description:</dt> | ||
7927 | <dd>Initiate or handle a stream restart after TLS negotiation. | ||
7928 | </dd> | ||
7929 | <dt>Section:</dt> | ||
7930 | <dd><a class='info' href='#tls-rules-restart'>Section 5.3.2<span> (</span><span class='info'>Restart</span><span>)</span></a> | ||
7931 | </dd> | ||
7932 | <dt>Roles:</dt> | ||
7933 | <dd>Client MUST, Server MUST. | ||
7934 | </dd> | ||
7935 | </dl></blockquote><p> | ||
7936 | |||
7937 | </p> | ||
7938 | <p> | ||
7939 | </p> | ||
7940 | <blockquote class="text"><dl> | ||
7941 | <dt>Feature:</dt> | ||
7942 | <dd>tls-support | ||
7943 | </dd> | ||
7944 | <dt>Description:</dt> | ||
7945 | <dd>Support Transport Layer Security for stream encryption. | ||
7946 | </dd> | ||
7947 | <dt>Section:</dt> | ||
7948 | <dd><a class='info' href='#tls'>Section 5<span> (</span><span class='info'>STARTTLS Negotiation</span><span>)</span></a> | ||
7949 | </dd> | ||
7950 | <dt>Roles:</dt> | ||
7951 | <dd>Client MUST, Server MUST. | ||
7952 | </dd> | ||
7953 | </dl></blockquote><p> | ||
7954 | |||
7955 | </p> | ||
7956 | <p> | ||
7957 | </p> | ||
7958 | <blockquote class="text"><dl> | ||
7959 | <dt>Feature:</dt> | ||
7960 | <dd>tls-correlate | ||
7961 | </dd> | ||
7962 | <dt>Description:</dt> | ||
7963 | <dd>When validating a certificate presented by a stream peer during TLS negotiation, correlate the validated identity with the 'from' address (if any) of the stream header it received from the peer. | ||
7964 | </dd> | ||
7965 | <dt>Section:</dt> | ||
7966 | <dd><a class='info' href='#security-certificates-validation'>Section 13.7.2<span> (</span><span class='info'>Certificate Validation</span><span>)</span></a> | ||
7967 | </dd> | ||
7968 | <dt>Roles:</dt> | ||
7969 | <dd>Client SHOULD, Server SHOULD. | ||
7970 | </dd> | ||
7971 | </dl></blockquote><p> | ||
7972 | |||
7973 | </p> | ||
7974 | <p> | ||
7975 | </p> | ||
7976 | <blockquote class="text"><dl> | ||
7977 | <dt>Feature:</dt> | ||
7978 | <dd>xml-namespace-content-client | ||
7979 | </dd> | ||
7980 | <dt>Description:</dt> | ||
7981 | <dd>Support 'jabber:client' as a content namespace. | ||
7982 | </dd> | ||
7983 | <dt>Section:</dt> | ||
7984 | <dd><a class='info' href='#streams-ns-content'>Section 4.8.2<span> (</span><span class='info'>Content Namespace</span><span>)</span></a> | ||
7985 | </dd> | ||
7986 | <dt>Roles:</dt> | ||
7987 | <dd>Client MUST, Server MUST. | ||
7988 | </dd> | ||
7989 | </dl></blockquote><p> | ||
7990 | |||
7991 | </p> | ||
7992 | <p> | ||
7993 | </p> | ||
7994 | <blockquote class="text"><dl> | ||
7995 | <dt>Feature:</dt> | ||
7996 | <dd>xml-namespace-content-server | ||
7997 | </dd> | ||
7998 | <dt>Description:</dt> | ||
7999 | <dd>Support 'jabber:server' as a content namespace. | ||
8000 | </dd> | ||
8001 | <dt>Section:</dt> | ||
8002 | <dd><a class='info' href='#streams-ns-content'>Section 4.8.2<span> (</span><span class='info'>Content Namespace</span><span>)</span></a> | ||
8003 | </dd> | ||
8004 | <dt>Roles:</dt> | ||
8005 | <dd>Client N/A, Server MUST. | ||
8006 | </dd> | ||
8007 | </dl></blockquote><p> | ||
8008 | |||
8009 | </p> | ||
8010 | <p> | ||
8011 | </p> | ||
8012 | <blockquote class="text"><dl> | ||
8013 | <dt>Feature:</dt> | ||
8014 | <dd>xml-namespace-streams-declaration | ||
8015 | </dd> | ||
8016 | <dt>Description:</dt> | ||
8017 | <dd>Ensure that there is a namespace declaration for the 'http://etherx.jabber.org/streams' namespace. | ||
8018 | </dd> | ||
8019 | <dt>Section:</dt> | ||
8020 | <dd><a class='info' href='#streams-ns-stream'>Section 4.8.1<span> (</span><span class='info'>Stream Namespace</span><span>)</span></a> | ||
8021 | </dd> | ||
8022 | <dt>Roles:</dt> | ||
8023 | <dd>Client MUST, Server MUST. | ||
8024 | </dd> | ||
8025 | </dl></blockquote><p> | ||
8026 | |||
8027 | </p> | ||
8028 | <p> | ||
8029 | </p> | ||
8030 | <blockquote class="text"><dl> | ||
8031 | <dt>Feature:</dt> | ||
8032 | <dd>xml-namespace-streams-prefix | ||
8033 | </dd> | ||
8034 | <dt>Description:</dt> | ||
8035 | <dd>Ensure that all elements qualified by the 'http://etherx.jabber.org/streams' namespace are prefixed by the prefix (if any) defined in the namespace declaration. | ||
8036 | </dd> | ||
8037 | <dt>Section:</dt> | ||
8038 | <dd><a class='info' href='#streams-ns-stream'>Section 4.8.1<span> (</span><span class='info'>Stream Namespace</span><span>)</span></a> | ||
8039 | </dd> | ||
8040 | <dt>Roles:</dt> | ||
8041 | <dd>Client MUST, Server MUST. | ||
8042 | </dd> | ||
8043 | </dl></blockquote><p> | ||
8044 | |||
8045 | </p> | ||
8046 | <p> | ||
8047 | </p> | ||
8048 | <blockquote class="text"><dl> | ||
8049 | <dt>Feature:</dt> | ||
8050 | <dd>xml-restriction-comment | ||
8051 | </dd> | ||
8052 | <dt>Description:</dt> | ||
8053 | <dd>Do not generate or accept XML comments. | ||
8054 | </dd> | ||
8055 | <dt>Section:</dt> | ||
8056 | <dd><a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a> | ||
8057 | </dd> | ||
8058 | <dt>Roles:</dt> | ||
8059 | <dd>Client MUST, Server MUST. | ||
8060 | </dd> | ||
8061 | </dl></blockquote><p> | ||
8062 | |||
8063 | </p> | ||
8064 | <p> | ||
8065 | </p> | ||
8066 | <blockquote class="text"><dl> | ||
8067 | <dt>Feature:</dt> | ||
8068 | <dd>xml-restriction-dtd | ||
8069 | </dd> | ||
8070 | <dt>Description:</dt> | ||
8071 | <dd>Do not generate or accept internal or external DTD subsets. | ||
8072 | </dd> | ||
8073 | <dt>Section:</dt> | ||
8074 | <dd><a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a> | ||
8075 | </dd> | ||
8076 | <dt>Roles:</dt> | ||
8077 | <dd>Client MUST, Server MUST. | ||
8078 | </dd> | ||
8079 | </dl></blockquote><p> | ||
8080 | |||
8081 | </p> | ||
8082 | <p> | ||
8083 | </p> | ||
8084 | <blockquote class="text"><dl> | ||
8085 | <dt>Feature:</dt> | ||
8086 | <dd>xml-restriction-pi | ||
8087 | </dd> | ||
8088 | <dt>Description:</dt> | ||
8089 | <dd>Do not generate or accept XML processing instructions. | ||
8090 | </dd> | ||
8091 | <dt>Section:</dt> | ||
8092 | <dd><a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a> | ||
8093 | </dd> | ||
8094 | <dt>Roles:</dt> | ||
8095 | <dd>Client MUST, Server MUST. | ||
8096 | </dd> | ||
8097 | </dl></blockquote><p> | ||
8098 | |||
8099 | </p> | ||
8100 | <p> | ||
8101 | </p> | ||
8102 | <blockquote class="text"><dl> | ||
8103 | <dt>Feature:</dt> | ||
8104 | <dd>xml-restriction-ref | ||
8105 | </dd> | ||
8106 | <dt>Description:</dt> | ||
8107 | <dd>Do not generate or accept internal or external entity references with the exception of the predefined entities. | ||
8108 | </dd> | ||
8109 | <dt>Section:</dt> | ||
8110 | <dd><a class='info' href='#xml-restrictions'>Section 11.1<span> (</span><span class='info'>XML Restrictions</span><span>)</span></a> | ||
8111 | </dd> | ||
8112 | <dt>Roles:</dt> | ||
8113 | <dd>Client MUST, Server MUST. | ||
8114 | </dd> | ||
8115 | </dl></blockquote><p> | ||
8116 | |||
8117 | </p> | ||
8118 | <p> | ||
8119 | </p> | ||
8120 | <blockquote class="text"><dl> | ||
8121 | <dt>Feature:</dt> | ||
8122 | <dd>xml-wellformed-xml | ||
8123 | </dd> | ||
8124 | <dt>Description:</dt> | ||
8125 | <dd>Do not generate or accept data that is not XML-well-formed. | ||
8126 | </dd> | ||
8127 | <dt>Section:</dt> | ||
8128 | <dd><a class='info' href='#xml-wellformed'>Section 11.3<span> (</span><span class='info'>Well-Formedness</span><span>)</span></a> | ||
8129 | </dd> | ||
8130 | <dt>Roles:</dt> | ||
8131 | <dd>Client MUST, Server MUST. | ||
8132 | </dd> | ||
8133 | </dl></blockquote><p> | ||
8134 | |||
8135 | </p> | ||
8136 | <p> | ||
8137 | </p> | ||
8138 | <blockquote class="text"><dl> | ||
8139 | <dt>Feature:</dt> | ||
8140 | <dd>xml-wellformed-ns | ||
8141 | </dd> | ||
8142 | <dt>Description:</dt> | ||
8143 | <dd>Do not generate or accept data that is not namespace-well-formed. | ||
8144 | </dd> | ||
8145 | <dt>Section:</dt> | ||
8146 | <dd><a class='info' href='#xml-wellformed'>Section 11.3<span> (</span><span class='info'>Well-Formedness</span><span>)</span></a> | ||
8147 | </dd> | ||
8148 | <dt>Roles:</dt> | ||
8149 | <dd>Client MUST, Server MUST. | ||
8150 | </dd> | ||
8151 | </dl></blockquote><p> | ||
8152 | |||
8153 | </p> | ||
8154 | <a name="rfc.references"></a><br /><hr /> | ||
8155 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8156 | <a name="rfc.section.16"></a><h3>16. | ||
8157 | References</h3> | ||
8158 | |||
8159 | <a name="rfc.references1"></a><br /><hr /> | ||
8160 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8161 | <h3>16.1. Normative References</h3> | ||
8162 | <table width="99%" border="0"> | ||
8163 | <tr><td class="author-text" valign="top"><a name="BASE64">[BASE64]</a></td> | ||
8164 | <td class="author-text">Josefsson, S., “<a href="http://tools.ietf.org/html/rfc4648">The Base16, Base32, and Base64 Data Encodings</a>,” RFC 4648, October 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4648.txt">TXT</a>).</td></tr> | ||
8165 | <tr><td class="author-text" valign="top"><a name="CHANNEL">[CHANNEL]</a></td> | ||
8166 | <td class="author-text">Williams, N., “<a href="http://tools.ietf.org/html/rfc5056">On the Use of Channel Bindings to Secure Channels</a>,” RFC 5056, November 2007 (<a href="http://www.rfc-editor.org/rfc/rfc5056.txt">TXT</a>).</td></tr> | ||
8167 | <tr><td class="author-text" valign="top"><a name="CHANNEL-TLS">[CHANNEL-TLS]</a></td> | ||
8168 | <td class="author-text">Altman, J., Williams, N., and L. Zhu, “<a href="http://tools.ietf.org/html/rfc5929">Channel Bindings for TLS</a>,” RFC 5929, July 2010 (<a href="http://www.rfc-editor.org/rfc/rfc5929.txt">TXT</a>).</td></tr> | ||
8169 | <tr><td class="author-text" valign="top"><a name="CHARSETS">[CHARSETS]</a></td> | ||
8170 | <td class="author-text"><a href="mailto:Harald.T.Alvestrand@uninett.no">Alvestrand, H.</a>, “<a href="http://tools.ietf.org/html/rfc2277">IETF Policy on Character Sets and Languages</a>,” BCP 18, RFC 2277, January 1998 (<a href="http://www.rfc-editor.org/rfc/rfc2277.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2277.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2277.xml">XML</a>).</td></tr> | ||
8171 | <tr><td class="author-text" valign="top"><a name="DNS-CONCEPTS">[DNS-CONCEPTS]</a></td> | ||
8172 | <td class="author-text">Mockapetris, P., “<a href="http://tools.ietf.org/html/rfc1034">Domain names - concepts and facilities</a>,” STD 13, RFC 1034, November 1987 (<a href="http://www.rfc-editor.org/rfc/rfc1034.txt">TXT</a>).</td></tr> | ||
8173 | <tr><td class="author-text" valign="top"><a name="DNS-SRV">[DNS-SRV]</a></td> | ||
8174 | <td class="author-text"><a href="mailto:arnt@troll.no">Gulbrandsen, A.</a>, Vixie, P., and <a href="mailto:levone@microsoft.com">L. Esibov</a>, “<a href="http://tools.ietf.org/html/rfc2782">A DNS RR for specifying the location of services (DNS SRV)</a>,” RFC 2782, February 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2782.txt">TXT</a>).</td></tr> | ||
8175 | <tr><td class="author-text" valign="top"><a name="IPv6-ADDR">[IPv6-ADDR]</a></td> | ||
8176 | <td class="author-text">Kawamura, S. and M. Kawashima, “<a href="http://tools.ietf.org/html/rfc5952">A Recommendation for IPv6 Address Text Representation</a>,” RFC 5952, August 2010 (<a href="http://www.rfc-editor.org/rfc/rfc5952.txt">TXT</a>).</td></tr> | ||
8177 | <tr><td class="author-text" valign="top"><a name="KEYWORDS">[KEYWORDS]</a></td> | ||
8178 | <td class="author-text"><a href="mailto:sob@harvard.edu">Bradner, S.</a>, “<a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>,” BCP 14, RFC 2119, March 1997 (<a href="http://www.rfc-editor.org/rfc/rfc2119.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2119.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2119.xml">XML</a>).</td></tr> | ||
8179 | <tr><td class="author-text" valign="top"><a name="LANGMATCH">[LANGMATCH]</a></td> | ||
8180 | <td class="author-text">Phillips, A. and M. Davis, “<a href="http://tools.ietf.org/html/rfc4647">Matching of Language Tags</a>,” BCP 47, RFC 4647, September 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4647.txt">TXT</a>).</td></tr> | ||
8181 | <tr><td class="author-text" valign="top"><a name="LANGTAGS">[LANGTAGS]</a></td> | ||
8182 | <td class="author-text">Phillips, A. and M. Davis, “<a href="http://tools.ietf.org/html/rfc5646">Tags for Identifying Languages</a>,” BCP 47, RFC 5646, September 2009 (<a href="http://www.rfc-editor.org/rfc/rfc5646.txt">TXT</a>).</td></tr> | ||
8183 | <tr><td class="author-text" valign="top"><a name="OCSP">[OCSP]</a></td> | ||
8184 | <td class="author-text"><a href="mailto:mmyers@verisign.com">Myers, M.</a>, <a href="mailto:rankney@erols.com">Ankney, R.</a>, <a href="mailto:ambarish@valicert.com">Malpani, A.</a>, <a href="mailto:galperin@mycfo.com">Galperin, S.</a>, and <a href="mailto:cadams@entrust.com">C. Adams</a>, “<a href="http://tools.ietf.org/html/rfc2560">X.509 Internet Public Key Infrastructure Online Certificate Status Protocol - OCSP</a>,” RFC 2560, June 1999 (<a href="http://www.rfc-editor.org/rfc/rfc2560.txt">TXT</a>).</td></tr> | ||
8185 | <tr><td class="author-text" valign="top"><a name="PKIX">[PKIX]</a></td> | ||
8186 | <td class="author-text">Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “<a href="http://tools.ietf.org/html/rfc5280">Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</a>,” RFC 5280, May 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5280.txt">TXT</a>).</td></tr> | ||
8187 | <tr><td class="author-text" valign="top"><a name="PKIX-ALGO">[PKIX-ALGO]</a></td> | ||
8188 | <td class="author-text">Jonsson, J. and B. Kaliski, “<a href="http://tools.ietf.org/html/rfc3447">Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1</a>,” RFC 3447, February 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3447.txt">TXT</a>).</td></tr> | ||
8189 | <tr><td class="author-text" valign="top"><a name="PKIX-SRV">[PKIX-SRV]</a></td> | ||
8190 | <td class="author-text">Santesson, S., “<a href="http://tools.ietf.org/html/rfc4985">Internet X.509 Public Key Infrastructure Subject Alternative Name for Expression of Service Name</a>,” RFC 4985, August 2007 (<a href="http://www.rfc-editor.org/rfc/rfc4985.txt">TXT</a>).</td></tr> | ||
8191 | <tr><td class="author-text" valign="top"><a name="PLAIN">[PLAIN]</a></td> | ||
8192 | <td class="author-text">Zeilenga, K., “<a href="http://tools.ietf.org/html/rfc4616">The PLAIN Simple Authentication and Security Layer (SASL) Mechanism</a>,” RFC 4616, August 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4616.txt">TXT</a>).</td></tr> | ||
8193 | <tr><td class="author-text" valign="top"><a name="RANDOM">[RANDOM]</a></td> | ||
8194 | <td class="author-text">Eastlake, D., Schiller, J., and S. Crocker, “<a href="http://tools.ietf.org/html/rfc4086">Randomness Requirements for Security</a>,” BCP 106, RFC 4086, June 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4086.txt">TXT</a>).</td></tr> | ||
8195 | <tr><td class="author-text" valign="top"><a name="SASL">[SASL]</a></td> | ||
8196 | <td class="author-text">Melnikov, A. and K. Zeilenga, “<a href="http://tools.ietf.org/html/rfc4422">Simple Authentication and Security Layer (SASL)</a>,” RFC 4422, June 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4422.txt">TXT</a>).</td></tr> | ||
8197 | <tr><td class="author-text" valign="top"><a name="SCRAM">[SCRAM]</a></td> | ||
8198 | <td class="author-text">Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, “<a href="http://tools.ietf.org/html/rfc5802">Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms</a>,” RFC 5802, July 2010 (<a href="http://www.rfc-editor.org/rfc/rfc5802.txt">TXT</a>).</td></tr> | ||
8199 | <tr><td class="author-text" valign="top"><a name="STRONGSEC">[STRONGSEC]</a></td> | ||
8200 | <td class="author-text">Schiller, J., “<a href="http://tools.ietf.org/html/rfc3365">Strong Security Requirements for Internet Engineering Task Force Standard Protocols</a>,” BCP 61, RFC 3365, August 2002 (<a href="http://www.rfc-editor.org/rfc/rfc3365.txt">TXT</a>).</td></tr> | ||
8201 | <tr><td class="author-text" valign="top"><a name="TCP">[TCP]</a></td> | ||
8202 | <td class="author-text">Postel, J., “<a href="http://tools.ietf.org/html/rfc793">Transmission Control Protocol</a>,” STD 7, RFC 793, September 1981 (<a href="http://www.rfc-editor.org/rfc/rfc793.txt">TXT</a>).</td></tr> | ||
8203 | <tr><td class="author-text" valign="top"><a name="TLS">[TLS]</a></td> | ||
8204 | <td class="author-text">Dierks, T. and E. Rescorla, “<a href="http://tools.ietf.org/html/rfc5246">The Transport Layer Security (TLS) Protocol Version 1.2</a>,” RFC 5246, August 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5246.txt">TXT</a>).</td></tr> | ||
8205 | <tr><td class="author-text" valign="top"><a name="TLS-CERTS">[TLS-CERTS]</a></td> | ||
8206 | <td class="author-text">Saint-Andre, P. and J. Hodges, “<a href="http://tools.ietf.org/html/rfc6125">Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)</a>,” RFC 6125, March 2011.</td></tr> | ||
8207 | <tr><td class="author-text" valign="top"><a name="TLS-NEG">[TLS-NEG]</a></td> | ||
8208 | <td class="author-text">Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, “<a href="http://tools.ietf.org/html/rfc5746">Transport Layer Security (TLS) Renegotiation Indication Extension</a>,” RFC 5746, February 2010 (<a href="http://www.rfc-editor.org/rfc/rfc5746.txt">TXT</a>).</td></tr> | ||
8209 | <tr><td class="author-text" valign="top"><a name="TLS-SSL2">[TLS-SSL2]</a></td> | ||
8210 | <td class="author-text">Turner, S. and T. Polk, “<a href="http://tools.ietf.org/html/rfc6176">Prohibiting Secure Sockets Layer (SSL) Version 2.0</a>,” RFC 6176, March 2011.</td></tr> | ||
8211 | <tr><td class="author-text" valign="top"><a name="UCS2">[UCS2]</a></td> | ||
8212 | <td class="author-text">International Organization for Standardization, “Information Technology - Universal Multiple-octet coded Character Set (UCS) - Amendment 2: UCS Transformation Format 8 (UTF-8),” ISO Standard 10646-1 Addendum 2, October 1996.</td></tr> | ||
8213 | <tr><td class="author-text" valign="top"><a name="UNICODE">[UNICODE]</a></td> | ||
8214 | <td class="author-text">The Unicode Consortium, “<a href="http://www.unicode.org/versions/Unicode6.0.0/">The Unicode Standard, Version 6.0</a>,” 2010.</td></tr> | ||
8215 | <tr><td class="author-text" valign="top"><a name="UTF-8">[UTF-8]</a></td> | ||
8216 | <td class="author-text">Yergeau, F., “<a href="http://tools.ietf.org/html/rfc3629">UTF-8, a transformation format of ISO 10646</a>,” STD 63, RFC 3629, November 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3629.txt">TXT</a>).</td></tr> | ||
8217 | <tr><td class="author-text" valign="top"><a name="URI">[URI]</a></td> | ||
8218 | <td class="author-text"><a href="mailto:timbl@w3.org">Berners-Lee, T.</a>, <a href="mailto:fielding@gbiv.com">Fielding, R.</a>, and <a href="mailto:LMM@acm.org">L. Masinter</a>, “<a href="http://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a>,” STD 66, RFC 3986, January 2005 (<a href="http://www.rfc-editor.org/rfc/rfc3986.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3986.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3986.xml">XML</a>).</td></tr> | ||
8219 | <tr><td class="author-text" valign="top"><a name="X509">[X509]</a></td> | ||
8220 | <td class="author-text">International Telecommunications Union, “Information technology - Open Systems Interconnection - The Directory: | ||
8221 | Public-key and attribute certificate frameworks,” ITU-T Recommendation X.509, ISO Standard 9594-8, March 2000.</td></tr> | ||
8222 | <tr><td class="author-text" valign="top"><a name="XML">[XML]</a></td> | ||
8223 | <td class="author-text">Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., and T. Bray, “<a href="http://www.w3.org/TR/2008/REC-xml-20081126">Extensible Markup Language (XML) 1.0 (Fifth Edition)</a>,” World Wide Web Consortium Recommendation REC-xml-20081126, November 2008 (<a href="http://www.w3.org/TR/2008/REC-xml-20081126">HTML</a>).</td></tr> | ||
8224 | <tr><td class="author-text" valign="top"><a name="XML-GUIDE">[XML-GUIDE]</a></td> | ||
8225 | <td class="author-text"><a href="mailto:shollenbeck@verisign.com">Hollenbeck, S.</a>, <a href="mailto:mrose@dbc.mtview.ca.us">Rose, M.</a>, and <a href="mailto:LMM@acm.org">L. Masinter</a>, “<a href="http://tools.ietf.org/html/rfc3470">Guidelines for the Use of Extensible Markup Language (XML) within IETF Protocols</a>,” BCP 70, RFC 3470, January 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3470.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3470.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3470.xml">XML</a>).</td></tr> | ||
8226 | <tr><td class="author-text" valign="top"><a name="XML-MEDIA">[XML-MEDIA]</a></td> | ||
8227 | <td class="author-text">Murata, M., St. Laurent, S., and D. Kohn, “<a href="http://tools.ietf.org/html/rfc3023">XML Media Types</a>,” RFC 3023, January 2001 (<a href="http://www.rfc-editor.org/rfc/rfc3023.txt">TXT</a>).</td></tr> | ||
8228 | <tr><td class="author-text" valign="top"><a name="XML-NAMES">[XML-NAMES]</a></td> | ||
8229 | <td class="author-text">Thompson, H., Hollander, D., Layman, A., Bray, T., and R. Tobin, “<a href="http://www.w3.org/TR/2009/REC-xml-names-20091208">Namespaces in XML 1.0 (Third Edition)</a>,” World Wide Web Consortium Recommendation REC-xml-names-20091208, December 2009 (<a href="http://www.w3.org/TR/2009/REC-xml-names-20091208">HTML</a>).</td></tr> | ||
8230 | <tr><td class="author-text" valign="top"><a name="XMPP-ADDR">[XMPP-ADDR]</a></td> | ||
8231 | <td class="author-text">Saint-Andre, P., “<a href="http://tools.ietf.org/html/rfc6122">Extensible Messaging and Presence Protocol (XMPP): Address Format</a>,” RFC 6122, March 2011.</td></tr> | ||
8232 | <tr><td class="author-text" valign="top"><a name="XMPP-IM">[XMPP-IM]</a></td> | ||
8233 | <td class="author-text">Saint-Andre, P., “<a href="http://tools.ietf.org/html/rfc6121">Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence</a>,” RFC 6121, March 2011.</td></tr> | ||
8234 | </table> | ||
8235 | |||
8236 | <a name="rfc.references2"></a><br /><hr /> | ||
8237 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8238 | <h3>16.2. Informative References</h3> | ||
8239 | <table width="99%" border="0"> | ||
8240 | <tr><td class="author-text" valign="top"><a name="AAA">[AAA]</a></td> | ||
8241 | <td class="author-text">Housley, R. and B. Aboba, “<a href="http://tools.ietf.org/html/rfc4962">Guidance for Authentication, Authorization, and Accounting (AAA) Key Management</a>,” BCP 132, RFC 4962, July 2007 (<a href="http://www.rfc-editor.org/rfc/rfc4962.txt">TXT</a>).</td></tr> | ||
8242 | <tr><td class="author-text" valign="top"><a name="ABNF">[ABNF]</a></td> | ||
8243 | <td class="author-text">Crocker, D. and P. Overell, “<a href="http://tools.ietf.org/html/rfc5234">Augmented BNF for Syntax Specifications: ABNF</a>,” STD 68, RFC 5234, January 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5234.txt">TXT</a>).</td></tr> | ||
8244 | <tr><td class="author-text" valign="top"><a name="ACAP">[ACAP]</a></td> | ||
8245 | <td class="author-text"><a href="mailto:chris.newman@innosoft.com">Newman, C.</a> and <a href="mailto:jgmyers@netscape.com">J. Myers</a>, “<a href="http://tools.ietf.org/html/rfc2244">ACAP -- Application Configuration Access Protocol</a>,” RFC 2244, November 1997 (<a href="http://www.rfc-editor.org/rfc/rfc2244.txt">TXT</a>).</td></tr> | ||
8246 | <tr><td class="author-text" valign="top"><a name="ANONYMOUS">[ANONYMOUS]</a></td> | ||
8247 | <td class="author-text">Zeilenga, K., “<a href="http://tools.ietf.org/html/rfc4505">Anonymous Simple Authentication and Security Layer (SASL) Mechanism</a>,” RFC 4505, June 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4505.txt">TXT</a>).</td></tr> | ||
8248 | <tr><td class="author-text" valign="top"><a name="ASN.1">[ASN.1]</a></td> | ||
8249 | <td class="author-text">CCITT, “Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1),” 1988.</td></tr> | ||
8250 | <tr><td class="author-text" valign="top"><a name="DIGEST-MD5">[DIGEST-MD5]</a></td> | ||
8251 | <td class="author-text">Leach, P. and C. Newman, “<a href="http://tools.ietf.org/html/rfc2831">Using Digest Authentication as a SASL Mechanism</a>,” RFC 2831, May 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2831.txt">TXT</a>).</td></tr> | ||
8252 | <tr><td class="author-text" valign="top"><a name="DNSSEC">[DNSSEC]</a></td> | ||
8253 | <td class="author-text">Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, “<a href="http://tools.ietf.org/html/rfc4033">DNS Security Introduction and Requirements</a>,” RFC 4033, March 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4033.txt">TXT</a>).</td></tr> | ||
8254 | <tr><td class="author-text" valign="top"><a name="DNS-TXT">[DNS-TXT]</a></td> | ||
8255 | <td class="author-text"><a href="mailto:rosenbaum@lkg.dec.com">Rosenbaum, R.</a>, “<a href="http://tools.ietf.org/html/rfc1464">Using the Domain Name System To Store Arbitrary String Attributes</a>,” RFC 1464, May 1993 (<a href="http://www.rfc-editor.org/rfc/rfc1464.txt">TXT</a>).</td></tr> | ||
8256 | <tr><td class="author-text" valign="top"><a name="DOS">[DOS]</a></td> | ||
8257 | <td class="author-text">Handley, M., Rescorla, E., and IAB, “<a href="http://tools.ietf.org/html/rfc4732">Internet Denial-of-Service Considerations</a>,” RFC 4732, December 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4732.txt">TXT</a>).</td></tr> | ||
8258 | <tr><td class="author-text" valign="top"><a name="E2E-REQS">[E2E-REQS]</a></td> | ||
8259 | <td class="author-text">Saint-Andre, P., “Requirements for End-to-End Encryption in the Extensible Messaging and Presence Protocol (XMPP),” Work in Progress, March 2010.</td></tr> | ||
8260 | <tr><td class="author-text" valign="top"><a name="EMAIL-ARCH">[EMAIL-ARCH]</a></td> | ||
8261 | <td class="author-text">Crocker, D., “<a href="http://tools.ietf.org/html/rfc5598">Internet Mail Architecture</a>,” RFC 5598, July 2009 (<a href="http://www.rfc-editor.org/rfc/rfc5598.txt">TXT</a>).</td></tr> | ||
8262 | <tr><td class="author-text" valign="top"><a name="ETHERNET">[ETHERNET]</a></td> | ||
8263 | <td class="author-text">“Information technology - Telecommunications and information exchange between systems - Local and metropolitan area networks - Specific requirements - Part 3: Carrier sense multiple access with collision detection (CSMA/CD) access method and physical layer specifications,” IEEE Standard 802.3, September 1998.</td></tr> | ||
8264 | <tr><td class="author-text" valign="top"><a name="GSS-API">[GSS-API]</a></td> | ||
8265 | <td class="author-text"><a href="mailto:jlinn@rsasecurity.com">Linn, J.</a>, “<a href="http://tools.ietf.org/html/rfc2743">Generic Security Service Application Program Interface Version 2, Update 1</a>,” RFC 2743, January 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2743.txt">TXT</a>).</td></tr> | ||
8266 | <tr><td class="author-text" valign="top"><a name="HASHES">[HASHES]</a></td> | ||
8267 | <td class="author-text">Hoffman, P. and B. Schneier, “<a href="http://tools.ietf.org/html/rfc4270">Attacks on Cryptographic Hashes in Internet Protocols</a>,” RFC 4270, November 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4270.txt">TXT</a>).</td></tr> | ||
8268 | <tr><td class="author-text" valign="top"><a name="HTTP">[HTTP]</a></td> | ||
8269 | <td class="author-text"><a href="mailto:fielding@ics.uci.edu">Fielding, R.</a>, <a href="mailto:jg@w3.org">Gettys, J.</a>, <a href="mailto:mogul@wrl.dec.com">Mogul, J.</a>, <a href="mailto:frystyk@w3.org">Frystyk, H.</a>, <a href="mailto:masinter@parc.xerox.com">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com">Leach, P.</a>, and <a href="mailto:timbl@w3.org">T. Berners-Lee</a>, “<a href="http://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>,” RFC 2616, June 1999 (<a href="http://www.rfc-editor.org/rfc/rfc2616.txt">TXT</a>, <a href="http://www.rfc-editor.org/rfc/rfc2616.ps">PS</a>, <a href="http://www.rfc-editor.org/rfc/rfc2616.pdf">PDF</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2616.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2616.xml">XML</a>).</td></tr> | ||
8270 | <tr><td class="author-text" valign="top"><a name="IANA-GUIDE">[IANA-GUIDE]</a></td> | ||
8271 | <td class="author-text">Narten, T. and H. Alvestrand, “<a href="http://tools.ietf.org/html/rfc5226">Guidelines for Writing an IANA Considerations Section in RFCs</a>,” BCP 26, RFC 5226, May 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5226.txt">TXT</a>).</td></tr> | ||
8272 | <tr><td class="author-text" valign="top"><a name="IANA-PORTS">[IANA-PORTS]</a></td> | ||
8273 | <td class="author-text">Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. Cheshire, “Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Transport Protocol Port Number and Service Name Registry,” Work in Progress, February 2011.</td></tr> | ||
8274 | <tr><td class="author-text" valign="top"><a name="IMAP">[IMAP]</a></td> | ||
8275 | <td class="author-text">Crispin, M., “<a href="http://tools.ietf.org/html/rfc3501">INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1</a>,” RFC 3501, March 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3501.txt">TXT</a>).</td></tr> | ||
8276 | <tr><td class="author-text" valign="top"><a name="IMP-REQS">[IMP-REQS]</a></td> | ||
8277 | <td class="author-text"><a href="mailto:mday@alum.mit.edu">Day, M.</a>, <a href="mailto:sonuag@microsoft.com">Aggarwal, S.</a>, and <a href="mailto:jesse@intonet.com">J. Vincent</a>, “<a href="http://tools.ietf.org/html/rfc2779">Instant Messaging / Presence Protocol Requirements</a>,” RFC 2779, February 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2779.txt">TXT</a>).</td></tr> | ||
8278 | <tr><td class="author-text" valign="top"><a name="INTEROP">[INTEROP]</a></td> | ||
8279 | <td class="author-text">Masinter, L., “Formalizing IETF Interoperability Reporting,” Work in Progress, October 2005.</td></tr> | ||
8280 | <tr><td class="author-text" valign="top"><a name="IRC">[IRC]</a></td> | ||
8281 | <td class="author-text">Kalt, C., “<a href="http://tools.ietf.org/html/rfc2810">Internet Relay Chat: Architecture</a>,” RFC 2810, April 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2810.txt">TXT</a>).</td></tr> | ||
8282 | <tr><td class="author-text" valign="top"><a name="IRI">[IRI]</a></td> | ||
8283 | <td class="author-text">Duerst, M. and M. Suignard, “<a href="http://tools.ietf.org/html/rfc3987">Internationalized Resource Identifiers (IRIs)</a>,” RFC 3987, January 2005 (<a href="http://www.rfc-editor.org/rfc/rfc3987.txt">TXT</a>).</td></tr> | ||
8284 | <tr><td class="author-text" valign="top"><a name="LDAP">[LDAP]</a></td> | ||
8285 | <td class="author-text">Zeilenga, K., “<a href="http://tools.ietf.org/html/rfc4510">Lightweight Directory Access Protocol (LDAP): Technical Specification Road Map</a>,” RFC 4510, June 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4510.txt">TXT</a>).</td></tr> | ||
8286 | <tr><td class="author-text" valign="top"><a name="LINKLOCAL">[LINKLOCAL]</a></td> | ||
8287 | <td class="author-text">Cheshire, S., Aboba, B., and E. Guttman, “<a href="http://tools.ietf.org/html/rfc3927">Dynamic Configuration of IPv4 Link-Local Addresses</a>,” RFC 3927, May 2005 (<a href="http://www.rfc-editor.org/rfc/rfc3927.txt">TXT</a>).</td></tr> | ||
8288 | <tr><td class="author-text" valign="top"><a name="MAILBOXES">[MAILBOXES]</a></td> | ||
8289 | <td class="author-text"><a href="mailto:dcrocker@imc.org">Crocker, D.</a>, “<a href="http://tools.ietf.org/html/rfc2142">MAILBOX NAMES FOR COMMON SERVICES, ROLES AND FUNCTIONS</a>,” RFC 2142, May 1997 (<a href="http://www.rfc-editor.org/rfc/rfc2142.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2142.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2142.xml">XML</a>).</td></tr> | ||
8290 | <tr><td class="author-text" valign="top"><a name="POP3">[POP3]</a></td> | ||
8291 | <td class="author-text"><a href="mailto:jgm+@cmu.edu">Myers, J.</a> and <a href="mailto:mrose@dbc.mtview.ca.us">M. Rose</a>, “<a href="http://tools.ietf.org/html/rfc1939">Post Office Protocol - Version 3</a>,” STD 53, RFC 1939, May 1996 (<a href="http://www.rfc-editor.org/rfc/rfc1939.txt">TXT</a>).</td></tr> | ||
8292 | <tr><td class="author-text" valign="top"><a name="PROCESS">[PROCESS]</a></td> | ||
8293 | <td class="author-text"><a href="mailto:sob@harvard.edu">Bradner, S.</a>, “<a href="http://tools.ietf.org/html/rfc2026">The Internet Standards Process -- Revision 3</a>,” BCP 9, RFC 2026, October 1996 (<a href="http://www.rfc-editor.org/rfc/rfc2026.txt">TXT</a>).</td></tr> | ||
8294 | <tr><td class="author-text" valign="top"><a name="REPORTS">[REPORTS]</a></td> | ||
8295 | <td class="author-text">Dusseault, L. and R. Sparks, “<a href="http://tools.ietf.org/html/rfc5657">Guidance on Interoperation and Implementation Reports for Advancement to Draft Standard</a>,” BCP 9, RFC 5657, September 2009 (<a href="http://www.rfc-editor.org/rfc/rfc5657.txt">TXT</a>).</td></tr> | ||
8296 | <tr><td class="author-text" valign="top"><a name="REST">[REST]</a></td> | ||
8297 | <td class="author-text">Fielding, R., “<a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf">Architectural Styles and the Design of Network-based Software Architectures</a>,” 2000.</td></tr> | ||
8298 | <tr><td class="author-text" valign="top"><a name="RFC3920">[RFC3920]</a></td> | ||
8299 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P., Ed.</a>, “<a href="http://tools.ietf.org/html/rfc3920">Extensible Messaging and Presence Protocol (XMPP): Core</a>,” RFC 3920, October 2004 (<a href="http://www.rfc-editor.org/rfc/rfc3920.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3920.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3920.xml">XML</a>).</td></tr> | ||
8300 | <tr><td class="author-text" valign="top"><a name="RFC3921">[RFC3921]</a></td> | ||
8301 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P., Ed.</a>, “<a href="http://tools.ietf.org/html/rfc3921">Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence</a>,” RFC 3921, October 2004 (<a href="http://www.rfc-editor.org/rfc/rfc3921.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3921.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3921.xml">XML</a>).</td></tr> | ||
8302 | <tr><td class="author-text" valign="top"><a name="SASLPREP">[SASLPREP]</a></td> | ||
8303 | <td class="author-text">Zeilenga, K., “<a href="http://tools.ietf.org/html/rfc4013">SASLprep: Stringprep Profile for User Names and Passwords</a>,” RFC 4013, February 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4013.txt">TXT</a>).</td></tr> | ||
8304 | <tr><td class="author-text" valign="top"><a name="SEC-TERMS">[SEC-TERMS]</a></td> | ||
8305 | <td class="author-text">Shirey, R., “<a href="http://tools.ietf.org/html/rfc4949">Internet Security Glossary, Version 2</a>,” RFC 4949, August 2007 (<a href="http://www.rfc-editor.org/rfc/rfc4949.txt">TXT</a>).</td></tr> | ||
8306 | <tr><td class="author-text" valign="top"><a name="SMTP">[SMTP]</a></td> | ||
8307 | <td class="author-text">Klensin, J., “<a href="http://tools.ietf.org/html/rfc5321">Simple Mail Transfer Protocol</a>,” RFC 5321, October 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5321.txt">TXT</a>).</td></tr> | ||
8308 | <tr><td class="author-text" valign="top"><a name="SEC-GUIDE">[SEC-GUIDE]</a></td> | ||
8309 | <td class="author-text">Rescorla, E. and B. Korver, “<a href="http://tools.ietf.org/html/rfc3552">Guidelines for Writing RFC Text on Security Considerations</a>,” BCP 72, RFC 3552, July 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3552.txt">TXT</a>).</td></tr> | ||
8310 | <tr><td class="author-text" valign="top"><a name="TLS-EXT">[TLS-EXT]</a></td> | ||
8311 | <td class="author-text">Eastlake 3rd, D., “<a href="http://tools.ietf.org/html/rfc6066">Transport Layer Security (TLS) Extensions: Extension Definitions</a>,” RFC 6066, January 2011 (<a href="http://www.rfc-editor.org/rfc/rfc6066.txt">TXT</a>).</td></tr> | ||
8312 | <tr><td class="author-text" valign="top"><a name="TLS-RESUME">[TLS-RESUME]</a></td> | ||
8313 | <td class="author-text">Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, “<a href="http://tools.ietf.org/html/rfc5077">Transport Layer Security (TLS) Session Resumption without Server-Side State</a>,” RFC 5077, January 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5077.txt">TXT</a>).</td></tr> | ||
8314 | <tr><td class="author-text" valign="top"><a name="URN-OID">[URN-OID]</a></td> | ||
8315 | <td class="author-text">Mealling, M., “<a href="http://tools.ietf.org/html/rfc3061">A URN Namespace of Object Identifiers</a>,” RFC 3061, February 2001 (<a href="http://www.rfc-editor.org/rfc/rfc3061.txt">TXT</a>).</td></tr> | ||
8316 | <tr><td class="author-text" valign="top"><a name="USINGTLS">[USINGTLS]</a></td> | ||
8317 | <td class="author-text"><a href="mailto:chris.newman@innosoft.com">Newman, C.</a>, “<a href="http://tools.ietf.org/html/rfc2595">Using TLS with IMAP, POP3 and ACAP</a>,” RFC 2595, June 1999 (<a href="http://www.rfc-editor.org/rfc/rfc2595.txt">TXT</a>).</td></tr> | ||
8318 | <tr><td class="author-text" valign="top"><a name="UUID">[UUID]</a></td> | ||
8319 | <td class="author-text"><a href="mailto:paulle@microsoft.com">Leach, P.</a>, <a href="mailto:michael@refactored-networks.com">Mealling, M.</a>, and <a href="mailto:rsalz@datapower.com">R. Salz</a>, “<a href="http://tools.ietf.org/html/rfc4122">A Universally Unique IDentifier (UUID) URN Namespace</a>,” RFC 4122, July 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4122.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc4122.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc4122.xml">XML</a>).</td></tr> | ||
8320 | <tr><td class="author-text" valign="top"><a name="XEP-0001">[XEP-0001]</a></td> | ||
8321 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0001.html">XMPP Extension Protocols</a>,” XSF XEP 0001, March 2010.</td></tr> | ||
8322 | <tr><td class="author-text" valign="top"><a name="XEP-0016">[XEP-0016]</a></td> | ||
8323 | <td class="author-text">Millard, P. and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://www.xmpp.org/extensions/xep-0016.html">Privacy Lists</a>,” XSF XEP 0016, February 2007.</td></tr> | ||
8324 | <tr><td class="author-text" valign="top"><a name="XEP-0045">[XEP-0045]</a></td> | ||
8325 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0045.html">Multi-User Chat</a>,” XSF XEP 0045, July 2007.</td></tr> | ||
8326 | <tr><td class="author-text" valign="top"><a name="XEP-0060">[XEP-0060]</a></td> | ||
8327 | <td class="author-text"><a href="mailto:">Millard, P.</a>, <a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, and <a href="mailto:ralphm@ik.nu">R. Meijer</a>, “<a href="http://www.xmpp.org/extensions/xep-0060.html">Publish-Subscribe</a>,” XSF XEP 0060, July 2010.</td></tr> | ||
8328 | <tr><td class="author-text" valign="top"><a name="XEP-0071">[XEP-0071]</a></td> | ||
8329 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0071.html">XHTML-IM</a>,” XSF XEP 0071, September 2008.</td></tr> | ||
8330 | <tr><td class="author-text" valign="top"><a name="XEP-0077">[XEP-0077]</a></td> | ||
8331 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0077.html">In-Band Registration</a>,” XSF XEP 0077, September 2009.</td></tr> | ||
8332 | <tr><td class="author-text" valign="top"><a name="XEP-0086">[XEP-0086]</a></td> | ||
8333 | <td class="author-text"><a href="mailto:rob@cataclysm.cx">Norris, R.</a> and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://xmpp.org/extensions/xep-0086.html">Error Condition Mappings</a>,” XSF XEP 0086, February 2004.</td></tr> | ||
8334 | <tr><td class="author-text" valign="top"><a name="XEP-0100">[XEP-0100]</a></td> | ||
8335 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a> and <a href="mailto:dizzyd@jabber.org">D. Smith</a>, “<a href="http://xmpp.org/extensions/xep-0100.html">Gateway Interaction</a>,” XSF XEP 0100, October 2005.</td></tr> | ||
8336 | <tr><td class="author-text" valign="top"><a name="XEP-0114">[XEP-0114]</a></td> | ||
8337 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://xmpp.org/extensions/xep-0114.html">Jabber Component Protocol</a>,” XSF XEP 0114, March 2005.</td></tr> | ||
8338 | <tr><td class="author-text" valign="top"><a name="XEP-0124">[XEP-0124]</a></td> | ||
8339 | <td class="author-text"><a href="mailto:ian.paterson@clientside.co.uk">Paterson, I.</a>, <a href="mailto:dizzyd@jabber.org">Smith, D.</a>, and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://www.xmpp.org/extensions/xep-0124.html">Bidirectional-streams Over Synchronous HTTP (BOSH)</a>,” XSF XEP 0124, July 2010.</td></tr> | ||
8340 | <tr><td class="author-text" valign="top"><a name="XEP-0138">[XEP-0138]</a></td> | ||
8341 | <td class="author-text"><a href="mailto:jhildebr@cisco.com">Hildebrand, J.</a> and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://xmpp.org/extensions/xep-0138.html">Stream Compression</a>,” XSF XEP 0138, May 2009.</td></tr> | ||
8342 | <tr><td class="author-text" valign="top"><a name="XEP-0156">[XEP-0156]</a></td> | ||
8343 | <td class="author-text"><a href="mailto:jhildebrand@jabber.com">Hildebrand, J.</a> and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://www.xmpp.org/extensions/xep-0156.html">Discovering Alternative XMPP Connection Methods</a>,” XSF XEP 0156, June 2007.</td></tr> | ||
8344 | <tr><td class="author-text" valign="top"><a name="XEP-0160">[XEP-0160]</a></td> | ||
8345 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0160.html">Best Practices for Handling Offline Messages</a>,” XSF XEP 0160, January 2006.</td></tr> | ||
8346 | <tr><td class="author-text" valign="top"><a name="XEP-0174">[XEP-0174]</a></td> | ||
8347 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0174.html">Link-Local Messaging</a>,” XSF XEP 0174, November 2008.</td></tr> | ||
8348 | <tr><td class="author-text" valign="top"><a name="XEP-0175">[XEP-0175]</a></td> | ||
8349 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0175.html">Best Practices for Use of SASL ANONYMOUS</a>,” XSF XEP 0175, September 2009.</td></tr> | ||
8350 | <tr><td class="author-text" valign="top"><a name="XEP-0178">[XEP-0178]</a></td> | ||
8351 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a> and <a href="mailto:">P. Millard</a>, “<a href="http://www.xmpp.org/extensions/xep-0178.html">Best Practices for Use of SASL EXTERNAL with Certificates</a>,” XSF XEP 0178, February 2007.</td></tr> | ||
8352 | <tr><td class="author-text" valign="top"><a name="XEP-0191">[XEP-0191]</a></td> | ||
8353 | <td class="author-text"><a href="mailto:">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0191.html">Simple Communications Blocking</a>,” XSF XEP 0191, February 2007.</td></tr> | ||
8354 | <tr><td class="author-text" valign="top"><a name="XEP-0198">[XEP-0198]</a></td> | ||
8355 | <td class="author-text"><a href="mailto:justin@affinix.com">Karneges, J.</a>, <a href="mailto:jhildebr@cisco.com">Hildebrand, J.</a>, <a href="mailto:">Saint-Andre, P.</a>, <a href="mailto:fabio.forno@gmail.com">Forno, F.</a>, Cridland, D., and M. Wild, “<a href="http://xmpp.org/extensions/xep-0198.html">Stream Management</a>,” XSF XEP 0198, February 2011.</td></tr> | ||
8356 | <tr><td class="author-text" valign="top"><a name="XEP-0199">[XEP-0199]</a></td> | ||
8357 | <td class="author-text"><a href="mailto:">Saint-Andre, P.</a>, “<a href="http://xmpp.org/extensions/xep-0199.html">XMPP Ping</a>,” XSF XEP 0199, June 2009.</td></tr> | ||
8358 | <tr><td class="author-text" valign="top"><a name="XEP-0205">[XEP-0205]</a></td> | ||
8359 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://www.xmpp.org/extensions/xep-0205.html">Best Practices to Discourage Denial of Service Attacks</a>,” XSF XEP 0205, January 2009.</td></tr> | ||
8360 | <tr><td class="author-text" valign="top"><a name="XEP-0206">[XEP-0206]</a></td> | ||
8361 | <td class="author-text"><a href="mailto:ian.paterson@clientside.co.uk">Paterson, I.</a> and <a href="mailto:stpeter@jabber.org">P. Saint-Andre</a>, “<a href="http://www.xmpp.org/extensions/xep-0206.html">XMPP Over BOSH</a>,” XSF XEP 0206, July 2010.</td></tr> | ||
8362 | <tr><td class="author-text" valign="top"><a name="XEP-0220">[XEP-0220]</a></td> | ||
8363 | <td class="author-text"><a href="mailto:jer@jabber.org">Miller, J.</a>, <a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, and <a href="mailto:">P. Hancke</a>, “<a href="http://xmpp.org/extensions/xep-0220.html">Server Dialback</a>,” XSF XEP 0220, March 2010.</td></tr> | ||
8364 | <tr><td class="author-text" valign="top"><a name="XEP-0225">[XEP-0225]</a></td> | ||
8365 | <td class="author-text"><a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, “<a href="http://xmpp.org/extensions/xep-0225.html">Component Connections</a>,” XSF XEP 0225, October 2008.</td></tr> | ||
8366 | <tr><td class="author-text" valign="top"><a name="XEP-0233">[XEP-0233]</a></td> | ||
8367 | <td class="author-text"><a href="mailto:linuxwolf@outer-planes.net">Miller, M.</a>, <a href="mailto:stpeter@jabber.org">Saint-Andre, P.</a>, and <a href="mailto:jhildebr@cisco.com">J. Hildebrand</a>, “<a href="http://xmpp.org/extensions/xep-0233.html">Domain-Based Service Names in XMPP SASL Negotiation</a>,” XSF XEP 0233, June 2010.</td></tr> | ||
8368 | <tr><td class="author-text" valign="top"><a name="XEP-0288">[XEP-0288]</a></td> | ||
8369 | <td class="author-text"><a href="mailto:">Hancke, P.</a> and <a href="mailto:dave.cridland@isode.com">D. Cridland</a>, “<a href="http://xmpp.org/extensions/xep-0288.html">Bidirectional Server-to-Server Connections</a>,” XSF XEP 0288, October 2010.</td></tr> | ||
8370 | <tr><td class="author-text" valign="top"><a name="XML-FRAG">[XML-FRAG]</a></td> | ||
8371 | <td class="author-text">Grosso, P. and D. Veillard, “<a href="http://www.w3.org/TR/2001/CR-xml-fragment-20010212">XML Fragment Interchange</a>,” World Wide Web Consortium CR CR-xml-fragment-20010212, February 2001 (<a href="http://www.w3.org/TR/2001/CR-xml-fragment-20010212">HTML</a>).</td></tr> | ||
8372 | <tr><td class="author-text" valign="top"><a name="XML-REG">[XML-REG]</a></td> | ||
8373 | <td class="author-text">Mealling, M., “<a href="http://tools.ietf.org/html/rfc3688">The IETF XML Registry</a>,” BCP 81, RFC 3688, January 2004 (<a href="http://www.rfc-editor.org/rfc/rfc3688.txt">TXT</a>).</td></tr> | ||
8374 | <tr><td class="author-text" valign="top"><a name="XML-SCHEMA">[XML-SCHEMA]</a></td> | ||
8375 | <td class="author-text">Thompson, H., Maloney, M., Mendelsohn, N., and D. Beech, “<a href="http://www.w3.org/TR/2004/REC-xmlschema-1-20041028">XML Schema Part 1: Structures Second Edition</a>,” World Wide Web Consortium Recommendation REC-xmlschema-1-20041028, October 2004 (<a href="http://www.w3.org/TR/2004/REC-xmlschema-1-20041028">HTML</a>).</td></tr> | ||
8376 | <tr><td class="author-text" valign="top"><a name="XMPP-URI">[XMPP-URI]</a></td> | ||
8377 | <td class="author-text">Saint-Andre, P., “<a href="http://tools.ietf.org/html/rfc5122">Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP)</a>,” RFC 5122, February 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5122.txt">TXT</a>).</td></tr> | ||
8378 | </table> | ||
8379 | |||
8380 | <a name="schema"></a><br /><hr /> | ||
8381 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8382 | <a name="rfc.section.A"></a><h3>Appendix A. | ||
8383 | XML Schemas</h3> | ||
8384 | |||
8385 | <p>The following schemas formally define various namespaces used in this document, in conformance with <a class='info' href='#XML-SCHEMA'>[XML‑SCHEMA]<span> (</span><span class='info'>Thompson, H., Maloney, M., Mendelsohn, N., and D. Beech, “XML Schema Part 1: Structures Second Edition,” October 2004.</span><span>)</span></a>. Because validation of XML streams and stanzas is optional, these schemas are not normative and are provided for descriptive purposes only. | ||
8386 | </p> | ||
8387 | <a name="schemas-stream"></a><br /><hr /> | ||
8388 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8389 | <a name="rfc.section.A.1"></a><h3>A.1. | ||
8390 | Stream Namespace</h3> | ||
8391 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8392 | <?xml version='1.0' encoding='UTF-8'?> | ||
8393 | |||
8394 | <xs:schema | ||
8395 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8396 | targetNamespace='http://etherx.jabber.org/streams' | ||
8397 | xmlns='http://etherx.jabber.org/streams' | ||
8398 | elementFormDefault='unqualified'> | ||
8399 | |||
8400 | <xs:import namespace='jabber:client'/> | ||
8401 | <xs:import namespace='jabber:server'/> | ||
8402 | <xs:import namespace='urn:ietf:params:xml:ns:xmpp-sasl'/> | ||
8403 | <xs:import namespace='urn:ietf:params:xml:ns:xmpp-streams'/> | ||
8404 | <xs:import namespace='urn:ietf:params:xml:ns:xmpp-tls'/> | ||
8405 | |||
8406 | <xs:element name='stream'> | ||
8407 | <xs:complexType> | ||
8408 | <xs:sequence xmlns:client='jabber:client' | ||
8409 | xmlns:server='jabber:server'> | ||
8410 | <xs:element ref='features' | ||
8411 | minOccurs='0' | ||
8412 | maxOccurs='1'/> | ||
8413 | <xs:any namespace='urn:ietf:params:xml:ns:xmpp-tls' | ||
8414 | minOccurs='0' | ||
8415 | maxOccurs='1'/> | ||
8416 | <xs:any namespace='urn:ietf:params:xml:ns:xmpp-sasl' | ||
8417 | minOccurs='0' | ||
8418 | maxOccurs='1'/> | ||
8419 | <xs:any namespace='##other' | ||
8420 | minOccurs='0' | ||
8421 | maxOccurs='unbounded' | ||
8422 | processContents='lax'/> | ||
8423 | <xs:choice minOccurs='0' maxOccurs='1'> | ||
8424 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
8425 | <xs:element ref='client:message'/> | ||
8426 | <xs:element ref='client:presence'/> | ||
8427 | <xs:element ref='client:iq'/> | ||
8428 | </xs:choice> | ||
8429 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
8430 | <xs:element ref='server:message'/> | ||
8431 | <xs:element ref='server:presence'/> | ||
8432 | <xs:element ref='server:iq'/> | ||
8433 | </xs:choice> | ||
8434 | </xs:choice> | ||
8435 | <xs:element ref='error' minOccurs='0' maxOccurs='1'/> | ||
8436 | </xs:sequence> | ||
8437 | <xs:attribute name='from' type='xs:string' use='optional'/> | ||
8438 | <xs:attribute name='id' type='xs:string' use='optional'/> | ||
8439 | <xs:attribute name='to' type='xs:string' use='optional'/> | ||
8440 | <xs:attribute name='version' type='xs:decimal' use='optional'/> | ||
8441 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8442 | <xs:anyAttribute namespace='##other' processContents='lax'/> | ||
8443 | </xs:complexType> | ||
8444 | </xs:element> | ||
8445 | |||
8446 | <xs:element name='features'> | ||
8447 | <xs:complexType> | ||
8448 | <xs:sequence> | ||
8449 | <xs:any namespace='##other' | ||
8450 | minOccurs='0' | ||
8451 | maxOccurs='unbounded' | ||
8452 | processContents='lax'/> | ||
8453 | </xs:sequence> | ||
8454 | </xs:complexType> | ||
8455 | </xs:element> | ||
8456 | |||
8457 | <xs:element name='error'> | ||
8458 | <xs:complexType> | ||
8459 | <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-streams'> | ||
8460 | <xs:group ref='err:streamErrorGroup'/> | ||
8461 | <xs:element ref='err:text' | ||
8462 | minOccurs='0' | ||
8463 | maxOccurs='1'/> | ||
8464 | <xs:any namespace='##other' | ||
8465 | minOccurs='0' | ||
8466 | maxOccurs='1' | ||
8467 | processContents='lax'/> | ||
8468 | </xs:sequence> | ||
8469 | </xs:complexType> | ||
8470 | </xs:element> | ||
8471 | |||
8472 | </xs:schema> | ||
8473 | </pre></div> | ||
8474 | <a name="schemas-streamerror"></a><br /><hr /> | ||
8475 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8476 | <a name="rfc.section.A.2"></a><h3>A.2. | ||
8477 | Stream Error Namespace</h3> | ||
8478 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8479 | <?xml version='1.0' encoding='UTF-8'?> | ||
8480 | |||
8481 | <xs:schema | ||
8482 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8483 | targetNamespace='urn:ietf:params:xml:ns:xmpp-streams' | ||
8484 | xmlns='urn:ietf:params:xml:ns:xmpp-streams' | ||
8485 | elementFormDefault='qualified'> | ||
8486 | |||
8487 | <xs:element name='bad-format' type='empty'/> | ||
8488 | <xs:element name='bad-namespace-prefix' type='empty'/> | ||
8489 | <xs:element name='conflict' type='empty'/> | ||
8490 | <xs:element name='connection-timeout' type='empty'/> | ||
8491 | <xs:element name='host-gone' type='empty'/> | ||
8492 | <xs:element name='host-unknown' type='empty'/> | ||
8493 | <xs:element name='improper-addressing' type='empty'/> | ||
8494 | <xs:element name='internal-server-error' type='empty'/> | ||
8495 | <xs:element name='invalid-from' type='empty'/> | ||
8496 | <xs:element name='invalid-id' type='empty'/> | ||
8497 | <xs:element name='invalid-namespace' type='empty'/> | ||
8498 | <xs:element name='invalid-xml' type='empty'/> | ||
8499 | <xs:element name='not-authorized' type='empty'/> | ||
8500 | <xs:element name='not-well-formed' type='empty'/> | ||
8501 | <xs:element name='policy-violation' type='empty'/> | ||
8502 | <xs:element name='remote-connection-failed' type='empty'/> | ||
8503 | <xs:element name='reset' type='empty'/> | ||
8504 | <xs:element name='resource-constraint' type='empty'/> | ||
8505 | <xs:element name='restricted-xml' type='empty'/> | ||
8506 | <xs:element name='see-other-host' type='xs:string'/> | ||
8507 | <xs:element name='system-shutdown' type='empty'/> | ||
8508 | <xs:element name='undefined-condition' type='empty'/> | ||
8509 | <xs:element name='unsupported-encoding' type='empty'/> | ||
8510 | <xs:element name='unsupported-stanza-type' type='empty'/> | ||
8511 | <xs:element name='unsupported-version' type='empty'/> | ||
8512 | |||
8513 | <xs:group name='streamErrorGroup'> | ||
8514 | <xs:choice> | ||
8515 | <xs:element ref='bad-format'/> | ||
8516 | <xs:element ref='bad-namespace-prefix'/> | ||
8517 | <xs:element ref='conflict'/> | ||
8518 | <xs:element ref='connection-timeout'/> | ||
8519 | <xs:element ref='host-gone'/> | ||
8520 | <xs:element ref='host-unknown'/> | ||
8521 | <xs:element ref='improper-addressing'/> | ||
8522 | <xs:element ref='internal-server-error'/> | ||
8523 | <xs:element ref='invalid-from'/> | ||
8524 | <xs:element ref='invalid-id'/> | ||
8525 | <xs:element ref='invalid-namespace'/> | ||
8526 | <xs:element ref='invalid-xml'/> | ||
8527 | <xs:element ref='not-authorized'/> | ||
8528 | <xs:element ref='not-well-formed'/> | ||
8529 | <xs:element ref='policy-violation'/> | ||
8530 | <xs:element ref='remote-connection-failed'/> | ||
8531 | <xs:element ref='reset'/> | ||
8532 | <xs:element ref='resource-constraint'/> | ||
8533 | <xs:element ref='restricted-xml'/> | ||
8534 | <xs:element ref='see-other-host'/> | ||
8535 | <xs:element ref='system-shutdown'/> | ||
8536 | <xs:element ref='undefined-condition'/> | ||
8537 | <xs:element ref='unsupported-encoding'/> | ||
8538 | <xs:element ref='unsupported-stanza-type'/> | ||
8539 | <xs:element ref='unsupported-version'/> | ||
8540 | </xs:choice> | ||
8541 | </xs:group> | ||
8542 | |||
8543 | <xs:element name='text'> | ||
8544 | <xs:complexType> | ||
8545 | <xs:simpleContent> | ||
8546 | <xs:extension base='xs:string'> | ||
8547 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8548 | </xs:extension> | ||
8549 | </xs:simpleContent> | ||
8550 | </xs:complexType> | ||
8551 | </xs:element> | ||
8552 | |||
8553 | <xs:simpleType name='empty'> | ||
8554 | <xs:restriction base='xs:string'> | ||
8555 | <xs:enumeration value=''/> | ||
8556 | </xs:restriction> | ||
8557 | </xs:simpleType> | ||
8558 | |||
8559 | </xs:schema> | ||
8560 | </pre></div> | ||
8561 | <a name="schemas-starttls"></a><br /><hr /> | ||
8562 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8563 | <a name="rfc.section.A.3"></a><h3>A.3. | ||
8564 | STARTTLS Namespace</h3> | ||
8565 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8566 | <?xml version='1.0' encoding='UTF-8'?> | ||
8567 | |||
8568 | <xs:schema | ||
8569 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8570 | targetNamespace='urn:ietf:params:xml:ns:xmpp-tls' | ||
8571 | xmlns='urn:ietf:params:xml:ns:xmpp-tls' | ||
8572 | elementFormDefault='qualified'> | ||
8573 | |||
8574 | <xs:element name='starttls'> | ||
8575 | <xs:complexType> | ||
8576 | <xs:choice minOccurs='0' maxOccurs='1'> | ||
8577 | <xs:element name='required' type='empty'/> | ||
8578 | </xs:choice> | ||
8579 | </xs:complexType> | ||
8580 | </xs:element> | ||
8581 | |||
8582 | <xs:element name='proceed' type='empty'/> | ||
8583 | |||
8584 | <xs:element name='failure' type='empty'/> | ||
8585 | |||
8586 | <xs:simpleType name='empty'> | ||
8587 | <xs:restriction base='xs:string'> | ||
8588 | <xs:enumeration value=''/> | ||
8589 | </xs:restriction> | ||
8590 | </xs:simpleType> | ||
8591 | |||
8592 | </xs:schema> | ||
8593 | </pre></div> | ||
8594 | <a name="schemas-sasl"></a><br /><hr /> | ||
8595 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8596 | <a name="rfc.section.A.4"></a><h3>A.4. | ||
8597 | SASL Namespace</h3> | ||
8598 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8599 | <?xml version='1.0' encoding='UTF-8'?> | ||
8600 | |||
8601 | <xs:schema | ||
8602 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8603 | targetNamespace='urn:ietf:params:xml:ns:xmpp-sasl' | ||
8604 | xmlns='urn:ietf:params:xml:ns:xmpp-sasl' | ||
8605 | elementFormDefault='qualified'> | ||
8606 | |||
8607 | <xs:element name='mechanisms'> | ||
8608 | <xs:complexType> | ||
8609 | <xs:sequence> | ||
8610 | <xs:element name='mechanism' | ||
8611 | minOccurs='1' | ||
8612 | maxOccurs='unbounded' | ||
8613 | type='xs:NMTOKEN'/> | ||
8614 | <xs:any namespace='##other' | ||
8615 | minOccurs='0' | ||
8616 | maxOccurs='unbounded' | ||
8617 | processContents='lax'/> | ||
8618 | </xs:sequence> | ||
8619 | </xs:complexType> | ||
8620 | </xs:element> | ||
8621 | |||
8622 | <xs:element name='abort' type='empty'/> | ||
8623 | |||
8624 | <xs:element name='auth'> | ||
8625 | <xs:complexType> | ||
8626 | <xs:simpleContent> | ||
8627 | <xs:extension base='xs:string'> | ||
8628 | <xs:attribute name='mechanism' | ||
8629 | type='xs:NMTOKEN' | ||
8630 | use='required'/> | ||
8631 | </xs:extension> | ||
8632 | </xs:simpleContent> | ||
8633 | </xs:complexType> | ||
8634 | </xs:element> | ||
8635 | |||
8636 | <xs:element name='challenge' type='xs:string'/> | ||
8637 | |||
8638 | <xs:element name='response' type='xs:string'/> | ||
8639 | |||
8640 | <xs:element name='success' type='xs:string'/> | ||
8641 | |||
8642 | <xs:element name='failure'> | ||
8643 | <xs:complexType> | ||
8644 | <xs:sequence> | ||
8645 | <xs:choice minOccurs='0'> | ||
8646 | <xs:element name='aborted' type='empty'/> | ||
8647 | <xs:element name='account-disabled' type='empty'/> | ||
8648 | <xs:element name='credentials-expired' type='empty'/> | ||
8649 | <xs:element name='encryption-required' type='empty'/> | ||
8650 | <xs:element name='incorrect-encoding' type='empty'/> | ||
8651 | <xs:element name='invalid-authzid' type='empty'/> | ||
8652 | <xs:element name='invalid-mechanism' type='empty'/> | ||
8653 | <xs:element name='malformed-request' type='empty'/> | ||
8654 | <xs:element name='mechanism-too-weak' type='empty'/> | ||
8655 | <xs:element name='not-authorized' type='empty'/> | ||
8656 | <xs:element name='temporary-auth-failure' type='empty'/> | ||
8657 | </xs:choice> | ||
8658 | <xs:element ref='text' minOccurs='0' maxOccurs='1'/> | ||
8659 | </xs:sequence> | ||
8660 | </xs:complexType> | ||
8661 | </xs:element> | ||
8662 | |||
8663 | <xs:element name='text'> | ||
8664 | <xs:complexType> | ||
8665 | <xs:simpleContent> | ||
8666 | <xs:extension base='xs:string'> | ||
8667 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8668 | </xs:extension> | ||
8669 | </xs:simpleContent> | ||
8670 | </xs:complexType> | ||
8671 | </xs:element> | ||
8672 | |||
8673 | <xs:simpleType name='empty'> | ||
8674 | <xs:restriction base='xs:string'> | ||
8675 | <xs:enumeration value=''/> | ||
8676 | </xs:restriction> | ||
8677 | </xs:simpleType> | ||
8678 | |||
8679 | </xs:schema> | ||
8680 | </pre></div> | ||
8681 | <a name="schemas-client"></a><br /><hr /> | ||
8682 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8683 | <a name="rfc.section.A.5"></a><h3>A.5. | ||
8684 | Client Namespace</h3> | ||
8685 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8686 | <?xml version='1.0' encoding='UTF-8'?> | ||
8687 | |||
8688 | <xs:schema | ||
8689 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8690 | targetNamespace='jabber:client' | ||
8691 | xmlns='jabber:client' | ||
8692 | elementFormDefault='qualified'> | ||
8693 | |||
8694 | <xs:import | ||
8695 | namespace='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
8696 | |||
8697 | <xs:element name='message'> | ||
8698 | <xs:complexType> | ||
8699 | <xs:sequence> | ||
8700 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
8701 | <xs:element ref='subject'/> | ||
8702 | <xs:element ref='body'/> | ||
8703 | <xs:element ref='thread'/> | ||
8704 | </xs:choice> | ||
8705 | <xs:any namespace='##other' | ||
8706 | minOccurs='0' | ||
8707 | maxOccurs='unbounded' | ||
8708 | processContents='lax'/> | ||
8709 | <xs:element ref='error' | ||
8710 | minOccurs='0'/> | ||
8711 | </xs:sequence> | ||
8712 | <xs:attribute name='from' | ||
8713 | type='xs:string' | ||
8714 | use='optional'/> | ||
8715 | <xs:attribute name='id' | ||
8716 | type='xs:NMTOKEN' | ||
8717 | use='optional'/> | ||
8718 | <xs:attribute name='to' | ||
8719 | type='xs:string' | ||
8720 | use='optional'/> | ||
8721 | <xs:attribute name='type' | ||
8722 | use='optional' | ||
8723 | default='normal'> | ||
8724 | <xs:simpleType> | ||
8725 | <xs:restriction base='xs:NMTOKEN'> | ||
8726 | <xs:enumeration value='chat'/> | ||
8727 | <xs:enumeration value='error'/> | ||
8728 | <xs:enumeration value='groupchat'/> | ||
8729 | <xs:enumeration value='headline'/> | ||
8730 | <xs:enumeration value='normal'/> | ||
8731 | </xs:restriction> | ||
8732 | </xs:simpleType> | ||
8733 | </xs:attribute> | ||
8734 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8735 | </xs:complexType> | ||
8736 | </xs:element> | ||
8737 | |||
8738 | <xs:element name='body'> | ||
8739 | <xs:complexType> | ||
8740 | <xs:simpleContent> | ||
8741 | <xs:extension base='xs:string'> | ||
8742 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8743 | </xs:extension> | ||
8744 | </xs:simpleContent> | ||
8745 | </xs:complexType> | ||
8746 | </xs:element> | ||
8747 | |||
8748 | <xs:element name='subject'> | ||
8749 | <xs:complexType> | ||
8750 | <xs:simpleContent> | ||
8751 | <xs:extension base='xs:string'> | ||
8752 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8753 | </xs:extension> | ||
8754 | </xs:simpleContent> | ||
8755 | </xs:complexType> | ||
8756 | </xs:element> | ||
8757 | |||
8758 | <xs:element name='thread'> | ||
8759 | <xs:complexType> | ||
8760 | <xs:simpleContent> | ||
8761 | <xs:extension base='xs:NMTOKEN'> | ||
8762 | <xs:attribute name='parent' | ||
8763 | type='xs:NMTOKEN' | ||
8764 | use='optional'/> | ||
8765 | </xs:extension> | ||
8766 | </xs:simpleContent> | ||
8767 | </xs:complexType> | ||
8768 | </xs:element> | ||
8769 | |||
8770 | <xs:element name='presence'> | ||
8771 | <xs:complexType> | ||
8772 | <xs:sequence> | ||
8773 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
8774 | <xs:element ref='show'/> | ||
8775 | <xs:element ref='status'/> | ||
8776 | <xs:element ref='priority'/> | ||
8777 | </xs:choice> | ||
8778 | <xs:any namespace='##other' | ||
8779 | minOccurs='0' | ||
8780 | maxOccurs='unbounded' | ||
8781 | processContents='lax'/> | ||
8782 | <xs:element ref='error' | ||
8783 | minOccurs='0'/> | ||
8784 | </xs:sequence> | ||
8785 | <xs:attribute name='from' | ||
8786 | type='xs:string' | ||
8787 | use='optional'/> | ||
8788 | <xs:attribute name='id' | ||
8789 | type='xs:NMTOKEN' | ||
8790 | use='optional'/> | ||
8791 | <xs:attribute name='to' | ||
8792 | type='xs:string' | ||
8793 | use='optional'/> | ||
8794 | <xs:attribute name='type' use='optional'> | ||
8795 | <xs:simpleType> | ||
8796 | <xs:restriction base='xs:NMTOKEN'> | ||
8797 | <xs:enumeration value='error'/> | ||
8798 | <xs:enumeration value='probe'/> | ||
8799 | <xs:enumeration value='subscribe'/> | ||
8800 | <xs:enumeration value='subscribed'/> | ||
8801 | <xs:enumeration value='unavailable'/> | ||
8802 | <xs:enumeration value='unsubscribe'/> | ||
8803 | <xs:enumeration value='unsubscribed'/> | ||
8804 | </xs:restriction> | ||
8805 | </xs:simpleType> | ||
8806 | </xs:attribute> | ||
8807 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8808 | </xs:complexType> | ||
8809 | </xs:element> | ||
8810 | |||
8811 | <xs:element name='show'> | ||
8812 | <xs:simpleType> | ||
8813 | <xs:restriction base='xs:NMTOKEN'> | ||
8814 | <xs:enumeration value='away'/> | ||
8815 | <xs:enumeration value='chat'/> | ||
8816 | <xs:enumeration value='dnd'/> | ||
8817 | <xs:enumeration value='xa'/> | ||
8818 | </xs:restriction> | ||
8819 | </xs:simpleType> | ||
8820 | </xs:element> | ||
8821 | |||
8822 | <xs:element name='status'> | ||
8823 | <xs:complexType> | ||
8824 | <xs:simpleContent> | ||
8825 | <xs:extension base='string1024'> | ||
8826 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8827 | </xs:extension> | ||
8828 | </xs:simpleContent> | ||
8829 | </xs:complexType> | ||
8830 | </xs:element> | ||
8831 | |||
8832 | <xs:simpleType name='string1024'> | ||
8833 | <xs:restriction base='xs:string'> | ||
8834 | <xs:minLength value='1'/> | ||
8835 | <xs:maxLength value='1024'/> | ||
8836 | </xs:restriction> | ||
8837 | </xs:simpleType> | ||
8838 | |||
8839 | <xs:element name='priority' type='xs:byte'/> | ||
8840 | |||
8841 | <xs:element name='iq'> | ||
8842 | <xs:complexType> | ||
8843 | <xs:sequence> | ||
8844 | <xs:any namespace='##other' | ||
8845 | minOccurs='0' | ||
8846 | maxOccurs='1' | ||
8847 | processContents='lax'/> | ||
8848 | <xs:element ref='error' | ||
8849 | minOccurs='0'/> | ||
8850 | </xs:sequence> | ||
8851 | <xs:attribute name='from' | ||
8852 | type='xs:string' | ||
8853 | use='optional'/> | ||
8854 | <xs:attribute name='id' | ||
8855 | type='xs:NMTOKEN' | ||
8856 | use='required'/> | ||
8857 | <xs:attribute name='to' | ||
8858 | type='xs:string' | ||
8859 | use='optional'/> | ||
8860 | <xs:attribute name='type' use='required'> | ||
8861 | <xs:simpleType> | ||
8862 | <xs:restriction base='xs:NMTOKEN'> | ||
8863 | <xs:enumeration value='error'/> | ||
8864 | <xs:enumeration value='get'/> | ||
8865 | <xs:enumeration value='result'/> | ||
8866 | <xs:enumeration value='set'/> | ||
8867 | </xs:restriction> | ||
8868 | </xs:simpleType> | ||
8869 | </xs:attribute> | ||
8870 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8871 | </xs:complexType> | ||
8872 | </xs:element> | ||
8873 | |||
8874 | <xs:element name='error'> | ||
8875 | <xs:complexType> | ||
8876 | <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-stanzas'> | ||
8877 | <xs:group ref='err:stanzaErrorGroup'/> | ||
8878 | <xs:element ref='err:text' | ||
8879 | minOccurs='0'/> | ||
8880 | </xs:sequence> | ||
8881 | <xs:attribute name='by' | ||
8882 | type='xs:string' | ||
8883 | use='optional'/> | ||
8884 | <xs:attribute name='type' use='required'> | ||
8885 | <xs:simpleType> | ||
8886 | <xs:restriction base='xs:NMTOKEN'> | ||
8887 | <xs:enumeration value='auth'/> | ||
8888 | <xs:enumeration value='cancel'/> | ||
8889 | <xs:enumeration value='continue'/> | ||
8890 | <xs:enumeration value='modify'/> | ||
8891 | <xs:enumeration value='wait'/> | ||
8892 | </xs:restriction> | ||
8893 | </xs:simpleType> | ||
8894 | </xs:attribute> | ||
8895 | </xs:complexType> | ||
8896 | </xs:element> | ||
8897 | |||
8898 | </xs:schema> | ||
8899 | </pre></div> | ||
8900 | <a name="schemas-server"></a><br /><hr /> | ||
8901 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
8902 | <a name="rfc.section.A.6"></a><h3>A.6. | ||
8903 | Server Namespace</h3> | ||
8904 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
8905 | <?xml version='1.0' encoding='UTF-8'?> | ||
8906 | |||
8907 | <xs:schema | ||
8908 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
8909 | targetNamespace='jabber:server' | ||
8910 | xmlns='jabber:server' | ||
8911 | elementFormDefault='qualified'> | ||
8912 | |||
8913 | <xs:import | ||
8914 | namespace='urn:ietf:params:xml:ns:xmpp-stanzas'/> | ||
8915 | |||
8916 | <xs:element name='message'> | ||
8917 | <xs:complexType> | ||
8918 | <xs:sequence> | ||
8919 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
8920 | <xs:element ref='subject'/> | ||
8921 | <xs:element ref='body'/> | ||
8922 | <xs:element ref='thread'/> | ||
8923 | </xs:choice> | ||
8924 | <xs:any namespace='##other' | ||
8925 | minOccurs='0' | ||
8926 | maxOccurs='unbounded' | ||
8927 | processContents='lax'/> | ||
8928 | <xs:element ref='error' | ||
8929 | minOccurs='0'/> | ||
8930 | </xs:sequence> | ||
8931 | <xs:attribute name='from' | ||
8932 | type='xs:string' | ||
8933 | use='required'/> | ||
8934 | <xs:attribute name='id' | ||
8935 | type='xs:NMTOKEN' | ||
8936 | use='optional'/> | ||
8937 | <xs:attribute name='to' | ||
8938 | type='xs:string' | ||
8939 | use='required'/> | ||
8940 | <xs:attribute name='type' | ||
8941 | use='optional' | ||
8942 | default='normal'> | ||
8943 | <xs:simpleType> | ||
8944 | <xs:restriction base='xs:NMTOKEN'> | ||
8945 | <xs:enumeration value='chat'/> | ||
8946 | <xs:enumeration value='error'/> | ||
8947 | <xs:enumeration value='groupchat'/> | ||
8948 | <xs:enumeration value='headline'/> | ||
8949 | <xs:enumeration value='normal'/> | ||
8950 | </xs:restriction> | ||
8951 | </xs:simpleType> | ||
8952 | </xs:attribute> | ||
8953 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8954 | </xs:complexType> | ||
8955 | </xs:element> | ||
8956 | |||
8957 | <xs:element name='body'> | ||
8958 | <xs:complexType> | ||
8959 | <xs:simpleContent> | ||
8960 | <xs:extension base='xs:string'> | ||
8961 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8962 | </xs:extension> | ||
8963 | </xs:simpleContent> | ||
8964 | </xs:complexType> | ||
8965 | </xs:element> | ||
8966 | |||
8967 | <xs:element name='subject'> | ||
8968 | <xs:complexType> | ||
8969 | <xs:simpleContent> | ||
8970 | <xs:extension base='xs:string'> | ||
8971 | <xs:attribute ref='xml:lang' use='optional'/> | ||
8972 | </xs:extension> | ||
8973 | </xs:simpleContent> | ||
8974 | </xs:complexType> | ||
8975 | </xs:element> | ||
8976 | |||
8977 | <xs:element name='thread'> | ||
8978 | <xs:complexType> | ||
8979 | <xs:simpleContent> | ||
8980 | <xs:extension base='xs:NMTOKEN'> | ||
8981 | <xs:attribute name='parent' | ||
8982 | type='xs:NMTOKEN' | ||
8983 | use='optional'/> | ||
8984 | </xs:extension> | ||
8985 | </xs:simpleContent> | ||
8986 | </xs:complexType> | ||
8987 | </xs:element> | ||
8988 | |||
8989 | <xs:element name='subject'> | ||
8990 | <xs:complexType> | ||
8991 | <xs:simpleContent> | ||
8992 | <xs:extension base='xs:NMTOKEN'> | ||
8993 | <xs:attribute name='parent' | ||
8994 | type='xs:NMTOKEN' | ||
8995 | use='optional'/> | ||
8996 | </xs:extension> | ||
8997 | </xs:simpleContent> | ||
8998 | </xs:complexType> | ||
8999 | </xs:element> | ||
9000 | |||
9001 | <xs:element name='presence'> | ||
9002 | <xs:complexType> | ||
9003 | <xs:sequence> | ||
9004 | <xs:choice minOccurs='0' maxOccurs='unbounded'> | ||
9005 | <xs:element ref='show'/> | ||
9006 | <xs:element ref='status'/> | ||
9007 | <xs:element ref='priority'/> | ||
9008 | </xs:choice> | ||
9009 | <xs:any namespace='##other' | ||
9010 | minOccurs='0' | ||
9011 | maxOccurs='unbounded' | ||
9012 | processContents='lax'/> | ||
9013 | <xs:element ref='error' | ||
9014 | minOccurs='0'/> | ||
9015 | </xs:sequence> | ||
9016 | <xs:attribute name='from' | ||
9017 | type='xs:string' | ||
9018 | use='required'/> | ||
9019 | <xs:attribute name='id' | ||
9020 | type='xs:NMTOKEN' | ||
9021 | use='optional'/> | ||
9022 | <xs:attribute name='to' | ||
9023 | type='xs:string' | ||
9024 | use='required'/> | ||
9025 | <xs:attribute name='type' use='optional'> | ||
9026 | <xs:simpleType> | ||
9027 | <xs:restriction base='xs:NMTOKEN'> | ||
9028 | <xs:enumeration value='error'/> | ||
9029 | <xs:enumeration value='probe'/> | ||
9030 | <xs:enumeration value='subscribe'/> | ||
9031 | <xs:enumeration value='subscribed'/> | ||
9032 | <xs:enumeration value='unavailable'/> | ||
9033 | <xs:enumeration value='unsubscribe'/> | ||
9034 | <xs:enumeration value='unsubscribed'/> | ||
9035 | </xs:restriction> | ||
9036 | </xs:simpleType> | ||
9037 | </xs:attribute> | ||
9038 | <xs:attribute ref='xml:lang' use='optional'/> | ||
9039 | </xs:complexType> | ||
9040 | </xs:element> | ||
9041 | |||
9042 | <xs:element name='show'> | ||
9043 | <xs:simpleType> | ||
9044 | <xs:restriction base='xs:NMTOKEN'> | ||
9045 | <xs:enumeration value='away'/> | ||
9046 | <xs:enumeration value='chat'/> | ||
9047 | <xs:enumeration value='dnd'/> | ||
9048 | <xs:enumeration value='xa'/> | ||
9049 | </xs:restriction> | ||
9050 | </xs:simpleType> | ||
9051 | </xs:element> | ||
9052 | |||
9053 | <xs:element name='status'> | ||
9054 | <xs:complexType> | ||
9055 | <xs:simpleContent> | ||
9056 | <xs:extension base='string1024'> | ||
9057 | <xs:attribute ref='xml:lang' use='optional'/> | ||
9058 | </xs:extension> | ||
9059 | </xs:simpleContent> | ||
9060 | </xs:complexType> | ||
9061 | </xs:element> | ||
9062 | |||
9063 | <xs:simpleType name='string1024'> | ||
9064 | <xs:restriction base='xs:string'> | ||
9065 | <xs:minLength value='1'/> | ||
9066 | <xs:maxLength value='1024'/> | ||
9067 | </xs:restriction> | ||
9068 | </xs:simpleType> | ||
9069 | |||
9070 | <xs:element name='priority' type='xs:byte' default='0'/> | ||
9071 | |||
9072 | <xs:element name='iq'> | ||
9073 | <xs:complexType> | ||
9074 | <xs:sequence> | ||
9075 | <xs:any namespace='##other' | ||
9076 | minOccurs='0' | ||
9077 | maxOccurs='1' | ||
9078 | processContents='lax'/> | ||
9079 | <xs:element ref='error' | ||
9080 | minOccurs='0'/> | ||
9081 | </xs:sequence> | ||
9082 | <xs:attribute name='from' | ||
9083 | type='xs:string' | ||
9084 | use='required'/> | ||
9085 | <xs:attribute name='id' | ||
9086 | type='xs:NMTOKEN' | ||
9087 | use='required'/> | ||
9088 | <xs:attribute name='to' | ||
9089 | type='xs:string' | ||
9090 | use='required'/> | ||
9091 | <xs:attribute name='type' use='required'> | ||
9092 | <xs:simpleType> | ||
9093 | <xs:restriction base='xs:NMTOKEN'> | ||
9094 | <xs:enumeration value='error'/> | ||
9095 | <xs:enumeration value='get'/> | ||
9096 | <xs:enumeration value='result'/> | ||
9097 | <xs:enumeration value='set'/> | ||
9098 | </xs:restriction> | ||
9099 | </xs:simpleType> | ||
9100 | </xs:attribute> | ||
9101 | <xs:attribute ref='xml:lang' use='optional'/> | ||
9102 | </xs:complexType> | ||
9103 | </xs:element> | ||
9104 | |||
9105 | <xs:element name='error'> | ||
9106 | <xs:complexType> | ||
9107 | <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-stanzas'> | ||
9108 | <xs:group ref='err:stanzaErrorGroup'/> | ||
9109 | <xs:element ref='err:text' | ||
9110 | minOccurs='0'/> | ||
9111 | </xs:sequence> | ||
9112 | <xs:attribute name='by' | ||
9113 | type='xs:string' | ||
9114 | use='optional'/> | ||
9115 | <xs:attribute name='type' use='required'> | ||
9116 | <xs:simpleType> | ||
9117 | <xs:restriction base='xs:NMTOKEN'> | ||
9118 | <xs:enumeration value='auth'/> | ||
9119 | <xs:enumeration value='cancel'/> | ||
9120 | <xs:enumeration value='continue'/> | ||
9121 | <xs:enumeration value='modify'/> | ||
9122 | <xs:enumeration value='wait'/> | ||
9123 | </xs:restriction> | ||
9124 | </xs:simpleType> | ||
9125 | </xs:attribute> | ||
9126 | </xs:complexType> | ||
9127 | </xs:element> | ||
9128 | |||
9129 | </xs:schema> | ||
9130 | </pre></div> | ||
9131 | <a name="schemas-bind"></a><br /><hr /> | ||
9132 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9133 | <a name="rfc.section.A.7"></a><h3>A.7. | ||
9134 | Resource Binding Namespace</h3> | ||
9135 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
9136 | <?xml version='1.0' encoding='UTF-8'?> | ||
9137 | |||
9138 | <xs:schema | ||
9139 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
9140 | targetNamespace='urn:ietf:params:xml:ns:xmpp-bind' | ||
9141 | xmlns='urn:ietf:params:xml:ns:xmpp-bind' | ||
9142 | elementFormDefault='qualified'> | ||
9143 | |||
9144 | <xs:element name='bind'> | ||
9145 | <xs:complexType> | ||
9146 | <xs:choice> | ||
9147 | <xs:element name='resource' type='resourceType'/> | ||
9148 | <xs:element name='jid' type='fullJIDType'/> | ||
9149 | </xs:choice> | ||
9150 | </xs:complexType> | ||
9151 | </xs:element> | ||
9152 | |||
9153 | <xs:simpleType name='fullJIDType'> | ||
9154 | <xs:restriction base='xs:string'> | ||
9155 | <xs:minLength value='8'/> | ||
9156 | <xs:maxLength value='3071'/> | ||
9157 | </xs:restriction> | ||
9158 | </xs:simpleType> | ||
9159 | |||
9160 | <xs:simpleType name='resourceType'> | ||
9161 | <xs:restriction base='xs:string'> | ||
9162 | <xs:minLength value='1'/> | ||
9163 | <xs:maxLength value='1023'/> | ||
9164 | </xs:restriction> | ||
9165 | </xs:simpleType> | ||
9166 | |||
9167 | </xs:schema> | ||
9168 | </pre></div> | ||
9169 | <a name="schemas-stanzaerror"></a><br /><hr /> | ||
9170 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9171 | <a name="rfc.section.A.8"></a><h3>A.8. | ||
9172 | Stanza Error Namespace</h3> | ||
9173 | <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre> | ||
9174 | <?xml version='1.0' encoding='UTF-8'?> | ||
9175 | |||
9176 | <xs:schema | ||
9177 | xmlns:xs='http://www.w3.org/2001/XMLSchema' | ||
9178 | targetNamespace='urn:ietf:params:xml:ns:xmpp-stanzas' | ||
9179 | xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' | ||
9180 | elementFormDefault='qualified'> | ||
9181 | |||
9182 | <xs:element name='bad-request' type='empty'/> | ||
9183 | <xs:element name='conflict' type='empty'/> | ||
9184 | <xs:element name='feature-not-implemented' type='empty'/> | ||
9185 | <xs:element name='forbidden' type='empty'/> | ||
9186 | <xs:element name='gone' type='xs:string'/> | ||
9187 | <xs:element name='internal-server-error' type='empty'/> | ||
9188 | <xs:element name='item-not-found' type='empty'/> | ||
9189 | <xs:element name='jid-malformed' type='empty'/> | ||
9190 | <xs:element name='not-acceptable' type='empty'/> | ||
9191 | <xs:element name='not-allowed' type='empty'/> | ||
9192 | <xs:element name='not-authorized' type='empty'/> | ||
9193 | <xs:element name='policy-violation' type='empty'/> | ||
9194 | <xs:element name='recipient-unavailable' type='empty'/> | ||
9195 | <xs:element name='redirect' type='xs:string'/> | ||
9196 | <xs:element name='registration-required' type='empty'/> | ||
9197 | <xs:element name='remote-server-not-found' type='empty'/> | ||
9198 | <xs:element name='remote-server-timeout' type='empty'/> | ||
9199 | <xs:element name='resource-constraint' type='empty'/> | ||
9200 | <xs:element name='service-unavailable' type='empty'/> | ||
9201 | <xs:element name='subscription-required' type='empty'/> | ||
9202 | <xs:element name='undefined-condition' type='empty'/> | ||
9203 | <xs:element name='unexpected-request' type='empty'/> | ||
9204 | |||
9205 | <xs:group name='stanzaErrorGroup'> | ||
9206 | <xs:choice> | ||
9207 | <xs:element ref='bad-request'/> | ||
9208 | <xs:element ref='conflict'/> | ||
9209 | <xs:element ref='feature-not-implemented'/> | ||
9210 | <xs:element ref='forbidden'/> | ||
9211 | <xs:element ref='gone'/> | ||
9212 | <xs:element ref='internal-server-error'/> | ||
9213 | <xs:element ref='item-not-found'/> | ||
9214 | <xs:element ref='jid-malformed'/> | ||
9215 | <xs:element ref='not-acceptable'/> | ||
9216 | <xs:element ref='not-authorized'/> | ||
9217 | <xs:element ref='not-allowed'/> | ||
9218 | <xs:element ref='policy-violation'/> | ||
9219 | <xs:element ref='recipient-unavailable'/> | ||
9220 | <xs:element ref='redirect'/> | ||
9221 | <xs:element ref='registration-required'/> | ||
9222 | <xs:element ref='remote-server-not-found'/> | ||
9223 | <xs:element ref='remote-server-timeout'/> | ||
9224 | <xs:element ref='resource-constraint'/> | ||
9225 | <xs:element ref='service-unavailable'/> | ||
9226 | <xs:element ref='subscription-required'/> | ||
9227 | <xs:element ref='undefined-condition'/> | ||
9228 | <xs:element ref='unexpected-request'/> | ||
9229 | </xs:choice> | ||
9230 | </xs:group> | ||
9231 | |||
9232 | <xs:element name='text'> | ||
9233 | <xs:complexType> | ||
9234 | <xs:simpleContent> | ||
9235 | <xs:extension base='xs:string'> | ||
9236 | <xs:attribute ref='xml:lang' use='optional'/> | ||
9237 | </xs:extension> | ||
9238 | </xs:simpleContent> | ||
9239 | </xs:complexType> | ||
9240 | </xs:element> | ||
9241 | |||
9242 | <xs:simpleType name='empty'> | ||
9243 | <xs:restriction base='xs:string'> | ||
9244 | <xs:enumeration value=''/> | ||
9245 | </xs:restriction> | ||
9246 | </xs:simpleType> | ||
9247 | |||
9248 | </xs:schema> | ||
9249 | </pre></div> | ||
9250 | <a name="contact"></a><br /><hr /> | ||
9251 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9252 | <a name="rfc.section.B"></a><h3>Appendix B. | ||
9253 | Contact Addresses</h3> | ||
9254 | |||
9255 | <p>Consistent with <a class='info' href='#MAILBOXES'>[MAILBOXES]<span> (</span><span class='info'>Crocker, D., “MAILBOX NAMES FOR COMMON SERVICES, ROLES AND FUNCTIONS,” May 1997.</span><span>)</span></a>, organization that offer XMPP services are encouraged to provide an Internet mailbox of "XMPP" for inquiries related to that service, where the host portion of the resulting mailto URI is the organization's domain, not the domain of the XMPP service itself (e.g., the XMPP service might be offered at im.example.com but the Internet mailbox would be <xmpp@example.com>). | ||
9256 | </p> | ||
9257 | <a name="provisioning"></a><br /><hr /> | ||
9258 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9259 | <a name="rfc.section.C"></a><h3>Appendix C. | ||
9260 | Account Provisioning</h3> | ||
9261 | |||
9262 | <p>Account provisioning is out of scope for this specification. | ||
9263 | Possible methods for account provisioning include account | ||
9264 | creation by a server administrator and in-band account | ||
9265 | registration using the 'jabber:iq:register' namespace as | ||
9266 | documented in <a class='info' href='#XEP-0077'>[XEP‑0077]<span> (</span><span class='info'>Saint-Andre, P., “In-Band Registration,” September 2009.</span><span>)</span></a>. An XMPP server | ||
9267 | implementation or administrative function MUST ensure that any | ||
9268 | JID assigned during account provisioning (including localpart, | ||
9269 | domainpart, resourcepart, and separator characters) conforms to | ||
9270 | the canonical format for XMPP addresses defined in | ||
9271 | <a class='info' href='#XMPP-ADDR'>[XMPP‑ADDR]<span> (</span><span class='info'>Saint-Andre, P., “Extensible Messaging and Presence Protocol (XMPP): Address Format,” March 2011.</span><span>)</span></a>. | ||
9272 | </p> | ||
9273 | <a name="diffs"></a><br /><hr /> | ||
9274 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9275 | <a name="rfc.section.D"></a><h3>Appendix D. | ||
9276 | Differences from RFC 3920</h3> | ||
9277 | |||
9278 | <p>Based on consensus derived from implementation and deployment experience as well as formal interoperability testing, the following substantive modifications were made from RFC 3920 (in addition to numerous changes of an editorial nature). | ||
9279 | </p> | ||
9280 | <p> | ||
9281 | </p> | ||
9282 | <ul class="text"> | ||
9283 | <li>Moved specification of the XMPP address format to a separate document. | ||
9284 | </li> | ||
9285 | <li>Recommended or mandated use of the 'from' and 'to' attributes on stream headers. | ||
9286 | </li> | ||
9287 | <li>More fully specified the stream closing handshake. | ||
9288 | </li> | ||
9289 | <li>Specified the recommended stream reconnection algorithm. | ||
9290 | </li> | ||
9291 | <li>Changed the name of the <xml-not-well-formed/> stream error condition to <not-well-formed/> for compliance with the XML specification. | ||
9292 | </li> | ||
9293 | <li>Removed the unnecessary and unused <invalid-id/> stream error (see RFC 3920 for historical documentation). | ||
9294 | </li> | ||
9295 | <li>Specified return of the <restricted-xml/> stream error in response to receipt of prohibited XML features. | ||
9296 | </li> | ||
9297 | <li>More completely specified the format and handling of the <see-other-host/> stream error, including consistency with RFC 3986 and RFC 5952 with regard to IPv6 addresses (e.g., enclosing the IPv6 address in square brackets '[' and ']'). | ||
9298 | </li> | ||
9299 | <li>Specified that the SASL SCRAM mechanism is a mandatory-to-implement technology for client-to-server streams. | ||
9300 | </li> | ||
9301 | <li>Specified that TLS plus the SASL PLAIN mechanism is a mandatory-to-implement technology for client-to-server streams. | ||
9302 | </li> | ||
9303 | <li>Specified that support for the SASL EXTERNAL mechanism is required for servers but only recommended for clients (since end-user X.509 certificates are difficult to obtain and not yet widely deployed). | ||
9304 | </li> | ||
9305 | <li>Removed the hard two-connection rule for server-to-server streams. | ||
9306 | </li> | ||
9307 | <li>More clearly specified the certificate profile for both public key certificates and issuer certificates. | ||
9308 | </li> | ||
9309 | <li>Added the <reset/> stream error (<a class='info' href='#streams-error-conditions-reset'>Section 4.9.3.16<span> (</span><span class='info'>reset</span><span>)</span></a>) condition to handle expired/revoked certificates or the addition of security-critical features to an existing stream. | ||
9310 | </li> | ||
9311 | <li>Added the <account-disabled/>, <credentials-expired/>, <encryption-required/>, and <malformed-request/> SASL error conditions to handle error flows mistakenly left out of RFC 3920 or discussed in RFC 4422 but not in RFC 2222. | ||
9312 | </li> | ||
9313 | <li>Removed the unused <payment-required/> stanza error. | ||
9314 | </li> | ||
9315 | <li>Removed the unnecessary requirement for escaping of characters that map to certain predefined entities, since they do not need to be escaped in XML. | ||
9316 | </li> | ||
9317 | <li>Clarified the process of DNS SRV lookups and fallbacks. | ||
9318 | </li> | ||
9319 | <li>Clarified the handling of SASL security layers. | ||
9320 | </li> | ||
9321 | <li>Clarified that a SASL simple user name is the localpart, not the bare JID. | ||
9322 | </li> | ||
9323 | <li>Clarified the stream negotiation process and associated flow chart. | ||
9324 | </li> | ||
9325 | <li>Clarified the handling of stream features. | ||
9326 | </li> | ||
9327 | <li>Added a 'by' attribute to the <error/> element for stanza errors so that the entity that has detected the error can include its JID for diagnostic or tracking purposes. | ||
9328 | </li> | ||
9329 | <li>Clarified the handling of data that violates the well-formedness definitions for XML 1.0 and XML namespaces. | ||
9330 | </li> | ||
9331 | <li>Specified the security considerations in more detail, especially with regard to presence leaks and denial-of-service attacks. | ||
9332 | </li> | ||
9333 | <li>Moved documentation of the Server Dialback protocol from this specification to a separate specification maintained by the XMPP Standards Foundation. | ||
9334 | </li> | ||
9335 | </ul><p> | ||
9336 | |||
9337 | </p> | ||
9338 | <a name="intro-ack"></a><br /><hr /> | ||
9339 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9340 | <a name="rfc.section.E"></a><h3>Appendix E. | ||
9341 | Acknowledgements</h3> | ||
9342 | |||
9343 | <p>This document is an update to, and derived from, RFC 3920. This document would have been impossible without the work of the contributors and commenters acknowledged there. | ||
9344 | </p> | ||
9345 | <p>Hundreds of people have provided implementation feedback, bug reports, requests for clarification, and suggestions for improvement since publication of RFC 3920. Although the document editor has endeavored to address all such feedback, he is solely responsible for any remaining errors and ambiguities. | ||
9346 | </p> | ||
9347 | <p>Special thanks are due to Kevin Smith, Matthew Wild, Dave Cridland, Philipp Hancke, Waqas Hussain, Florian Zeitz, Ben Campbell, Jehan Pages, Paul Aurich, Justin Karneges, Kurt Zeilenga, Simon Josefsson, Ralph Meijer, Curtis King, and others for their comments during Working Group Last Call. | ||
9348 | </p> | ||
9349 | <p>Thanks also to Yaron Sheffer and Elwyn Davies for their reviews on behalf of the Security Directorate and the General Area Review Team, respectively. | ||
9350 | </p> | ||
9351 | <p>The Working Group chairs were Ben Campbell and Joe Hildebrand. The responsible Area Director was Gonzalo Camarillo. | ||
9352 | </p> | ||
9353 | <a name="rfc.authors"></a><br /><hr /> | ||
9354 | <table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table> | ||
9355 | <h3>Author's Address</h3> | ||
9356 | <table width="99%" border="0" cellpadding="0" cellspacing="0"> | ||
9357 | <tr><td class="author-text"> </td> | ||
9358 | <td class="author-text">Peter Saint-Andre</td></tr> | ||
9359 | <tr><td class="author-text"> </td> | ||
9360 | <td class="author-text">Cisco</td></tr> | ||
9361 | <tr><td class="author-text"> </td> | ||
9362 | <td class="author-text">1899 Wyknoop Street, Suite 600</td></tr> | ||
9363 | <tr><td class="author-text"> </td> | ||
9364 | <td class="author-text">Denver, CO 80202</td></tr> | ||
9365 | <tr><td class="author-text"> </td> | ||
9366 | <td class="author-text">USA</td></tr> | ||
9367 | <tr><td class="author" align="right">Phone: </td> | ||
9368 | <td class="author-text">+1-303-308-3282</td></tr> | ||
9369 | <tr><td class="author" align="right">EMail: </td> | ||
9370 | <td class="author-text"><a href="mailto:psaintan@cisco.com">psaintan@cisco.com</a></td></tr> | ||
9371 | </table> | ||
9372 | </body></html> | ||