No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0156.xml 13KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Discovering Alternative XMPP Connection Methods</title>
  10. <abstract>This document defines a DNS TXT Resource Record format for use in discovering alternative methods of connecting to an XMPP server.</abstract>
  12. <number>0156</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>RFC 1464</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>alt-connections</shortname>
  24. <registry/>
  25. &hildjj;
  26. &stpeter;
  27. &lance;
  28. <revision>
  29. <version>1.1.2</version>
  30. <date>2016-06-07</date>
  31. <initials>XSF Editor: ssw</initials>
  32. <remark>
  33. <ul>
  34. <li>Clarify that the XML version of the XRD document is required by the RFC and the JSON version is optional.</li>
  35. <li>Update references to draft-ietf-xmpp-websocket to point to RFC 7395.</li>
  36. </ul>
  37. </remark>
  38. </revision>
  39. <revision>
  40. <version>1.1.1</version>
  41. <date>2016-06-06</date>
  42. <initials>XSF Editor: ssw</initials>
  43. <remark><p>Fix a small typo in one of the examples (UTF-9 encoding).</p></remark>
  44. </revision>
  45. <revision>
  46. <version>1.1</version>
  47. <date>2014-01-08</date>
  48. <initials>ls/psa</initials>
  49. <remark><p>Defined HTTP lookup methods using well-known URIs as specified in RFC 5785.</p></remark>
  50. </revision>
  51. <revision>
  52. <version>1.0</version>
  53. <date>2007-06-12</date>
  54. <initials>psa</initials>
  55. <remark><p>Per a vote of the XMPP Council, advanced status to Draft; XMPP Registrar assigned alt-connections shortname and created appropriate registry.</p></remark>
  56. </revision>
  57. <revision>
  58. <version>0.7</version>
  59. <date>2007-04-18</date>
  60. <initials>psa</initials>
  61. <remark><p>Updated to reflect renaming of HTTP Binding to XMPP Over BOSH.</p></remark>
  62. </revision>
  63. <revision>
  64. <version>0.6</version>
  65. <date>2007-01-30</date>
  66. <initials>psa</initials>
  67. <remark><p>Finally and definitively removed _xmpp-client-tcp and _xmpp-server-tcp attributes since clients and servers should use either SRV records or standard XMPP ports (5222 or 5269).</p></remark>
  68. </revision>
  69. <revision>
  70. <version>0.5</version>
  71. <date>2007-01-30</date>
  72. <initials>psa</initials>
  73. <remark><p>Removed _xmpp-client-tcpssl attribute since use of the old-style SSL-only port is discouraged.</p></remark>
  74. </revision>
  75. <revision>
  76. <version>0.4</version>
  77. <date>2007-01-29</date>
  78. <initials>psa</initials>
  79. <remark><p>Added _xmpp-client-tcpssl for old-style SSL connections; added discussion of IETF U-NAPTR technology.</p></remark>
  80. </revision>
  81. <revision>
  82. <version>0.3</version>
  83. <date>2006-05-16</date>
  84. <initials>psa</initials>
  85. <remark><p>Clarified order of lookups; restored _xmpp-client-tcp and added _xmpp-server-tcp as optional records if SRV is not supported or accessible.</p></remark>
  86. </revision>
  87. <revision>
  88. <version>0.2</version>
  89. <date>2005-12-05</date>
  90. <initials>psa</initials>
  91. <remark><p>Removed _xmpp-client-tcp from TXT records (belongs in SRV records only).</p></remark>
  92. </revision>
  93. <revision>
  94. <version>0.1</version>
  95. <date>2005-09-08</date>
  96. <initials>psa</initials>
  97. <remark><p>Initial version.</p></remark>
  98. </revision>
  99. <revision>
  100. <version>0.0.3</version>
  101. <date>2005-09-07</date>
  102. <initials>psa</initials>
  103. <remark><p>More fully specified the rationale for using DNS TXT records.</p></remark>
  104. </revision>
  105. <revision>
  106. <version>0.0.2</version>
  107. <date>2005-08-27</date>
  108. <initials>psa</initials>
  109. <remark><p>Added security considerations and registrar considerations.</p></remark>
  110. </revision>
  111. <revision>
  112. <version>0.0.1</version>
  113. <date>2005-08-23</date>
  114. <initials>psa/jh</initials>
  115. <remark><p>First draft.</p></remark>
  116. </revision>
  117. </header>
  118. <section1 topic='Introduction' anchor='intro'>
  119. <p>Although &xmppcore; specifies the use of TCP as the method of connecting to an XMPP server, alternative connection methods exist, including the &xep0124; method (for which &xep0206; is the XMPP profile) and the websocket subprotocol specified in &rfc7395;. For some of these methods, it is necessary to discover further parameters before connecting, such as the HTTP URL of an alternative connection manager. Without ways to auto-discover alternative connection methods, the relevant information would need to be provided manually by a human user (which is cumbersome and error-prone) or hard-coded into XMPP software applications (which is brittle and not interoperable).</p>
  120. <p>This document defines two ways to encapsulate information about alternative connection methods for auto-discovery:</p>
  121. <ol>
  122. <li>DNS TXT resource records</li>
  123. <li>Link entries in a server's "host-meta" file</li>
  124. </ol>
  125. </section1>
  126. <section1 topic='DNS Lookup Method' anchor='dns'>
  127. <section2 topic='Record Format' anchor='dnsformat'>
  128. <p>The following format for DNS TXT resource records is specified in <cite>RFC 1464</cite>:</p>
  129. <code><![CDATA[<owner> <class> <ttl> <TXT> <"attribute name=attribute value">]]></code>
  130. <p>This document specifies that the following additional rules apply for DNS TXT resource records used to specify alternative connection methods:</p>
  131. <ol>
  132. <li>It is RECOMMENDED for the owner to be "_xmppconnect".</li>
  133. <li>The class field SHOULD be IN.</li>
  134. <li>The ttl field is OPTIONAL.</li>
  135. <li>The attribute name SHOULD begin with the string "_xmpp-client-" or "_xmpp-server-" and SHOULD be registered as described in the <link url='#registrar'>XMPP Registrar Considerations</link> section of this document.</li>
  136. <li>If the txt-data field contains only an attribute name (i.e., no unquoted "=" character followed by additional characters), the receiving application SHOULD interpret it as indicating the presence of the attribute or feature with no defined value.</li>
  137. <li>If the txt-data field contains an unquoted "=" character, it MUST also contain an attribute value.</li>
  138. </ol>
  139. </section2>
  140. <section2 topic='Business Rules' anchor='dnsbizrules'>
  141. <p>The following business rules apply:</p>
  142. <ol start='1'>
  143. <li>TXT lookups MUST be used only as a fallback after the methods specified in <cite>RFC 6120</cite> have been exhausted. <note>The point of this rule is to prevent someone from defining a new XEP-0156 connection method like "_xmpp-client-tcp" to override the SRV records defined in the core XMPP specification.</note></li>
  144. <li>A domain SHOULD NOT present information in DNS TXT records that is available via the DNS SRV records defined in <cite>RFC 6120</cite>.</li>
  145. <li>The order of DNS TXT records SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.</li>
  146. </ol>
  147. </section2>
  148. <section2 topic='Examples' anchor='dnsexamples'>
  149. <p>The following examples show two DNS TXT resource records: the first indicates support for the XMPP Over BOSH connection method defined in <cite>XEP-0124</cite> and <cite>XEP-0206</cite> and the second indicates support for XMPP over WebSocket connections defined in <cite>RFC 7395</cite>;.</p>
  150. <example caption='TXT Resource Records'><![CDATA[
  151. _xmppconnect IN TXT "_xmpp-client-xbosh="
  152. _xmppconnect IN TXT "_xmpp-client-websocket=wss://"
  153. ]]></example>
  154. </section2>
  155. </section1>
  156. <section1 topic='HTTP Lookup Method' anchor='http'>
  157. <section2 topic='Link Format' anchor='httpformat'>
  158. <p>The HTTP lookup method uses Web Host Metadata &rfc6415; to categorize and list the URIs of alternative connection methods. It is primarily intended for use by clients in environments where the ability to perform DNS queries is restricted, such as in web browsers.</p>
  159. <p>Each alternative connection method is specified in the host-meta (XRD) file using a distinctive link relation &rfc5988;. This specification defines several extension relation types:</p>
  160. <ul>
  161. <li>urn:xmpp:alt-connections:httppoll</li>
  162. <li>urn:xmpp:alt-connections:websocket</li>
  163. <li>urn:xmpp:alt-connections:xbosh</li>
  164. </ul>
  165. </section2>
  166. <section2 topic='Business Rules' anchor='httpbizrules'>
  167. <p>The following business rules apply:</p>
  168. <ol start='1'>
  169. <li>HTTP queries for host-meta information MUST be used only as a fallback after the methods specified in <cite>RFC 6120</cite> have been exhausted.</li>
  170. <li>A domain SHOULD NOT present information in host-meta link records that is available via the DNS SRV records defined in <cite>RFC 6120</cite>.</li>
  171. <li>The order of XMPP related link entries in the host-meta file SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.</li>
  172. </ol>
  173. </section2>
  174. <section2 topic='Examples' anchor='httpexamples'>
  175. <p>The following examples show two host-meta link records: the first indicates support for the XMPP Over BOSH connection method defined in <cite>XEP-0124</cite> and <cite>XEP-0206</cite> and the second indicates support for the XMPP Over WebSocket connection method defined in <cite>draft-ietf-xmpp-websocket</cite>.</p>
  176. <p>As specified in <cite>RFC 6120</cite> &sect;3, support for the XML encoding of the host-meta resource is REQUIRED while alternative representations such as JSON are OPTIONAL.</p>
  177. <example caption='Result for /.well-known/host-meta'><![CDATA[<?xml version='1.0' encoding=utf-8'?>
  178. <XRD xmlns=''>
  179. ...
  180. <Link rel="urn:xmpp:alt-connections:xbosh"
  181. href="" />
  182. <Link rel="urn:xmpp:alt-connections:websocket"
  183. href="wss://" />
  184. ...
  185. </XRD>
  186. ]]></example>
  187. <p>It is possible to use an alternative JSON format for host-meta information, in which case the above example would be presented as:</p>
  188. <example caption='Result for /.well-known/host-meta.json'><![CDATA[{
  189. ...
  190. "links": [
  191. ...
  192. {
  193. "rel": "urn:xmpp:alt-connections:xbosh",
  194. "href": ""
  195. },
  196. {
  197. "rel": "urn:xmpp:alt-connections:websocket",
  198. "href": "wss://"
  199. },
  200. ...
  201. ]
  202. }
  203. ]]></example>
  204. </section2>
  205. </section1>
  206. <section1 topic='Security Considerations' anchor='security'>
  207. <p>It is possible that advertisement of alternative connection methods can introduce security vulnerabilities, since a connecting entity (usually a client) might deliberately seek to connect using the method with the weakest security mechanisms (e.g., no channel encryption or relatively weak authentication). Care needs to be taken in determining which alternative connection methods are appropriate to advertise.</p>
  208. <p>Entities that use these connection methods MUST conform to the security considerations of each method, for example by preferring to use 'https' or 'wss' URLs that are protected using Transport Layer Security (TLS).</p>
  209. </section1>
  210. <section1 topic='IANA Considerations' anchor='iana'>
  211. <p>Because the link relations specified here are extension relation types rather than registered relation types (see Section 4 of RFC 5988), this document requires no interaction with &IANA;.</p>
  212. </section1>
  213. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  214. <section2 topic='Namespaces' anchor='ns'>
  215. <p>The &REGISTRAR; shall include 'urn:xmpp:alt-connections' in its registry of protocol namespaces (see &NAMESPACES;).</p>
  216. <ul>
  217. <li>urn:xmpp:alt-connections</li>
  218. </ul>
  219. </section2>
  220. <section2 topic='Alternative Connection Methods Registry' anchor='registrar-altconn'>
  221. <p>The &REGISTRAR; maintains a registry of attributes for use in DNS TXT resource records that advertise alternative XMPP connection methods (see &ALTCONN;).</p>
  222. <section3 topic='Process' anchor='registrar-altconn-process'>
  224. <code><![CDATA[
  225. <method>
  226. <name>the name of the attribute to be used in DNS TXT records</name>
  227. <desc>a natural-language description of the alternative connection method</desc>
  228. <syntax>the syntax of the DNS TXT record attribute value</syntax>
  229. <doc>the document in which the alternative connection method is specified</doc>
  230. </method>
  231. ]]></code>
  232. <p>The registrant can register more than one attribute at a time, each contained in a separate &lt;method/&gt; element.</p>
  233. </section3>
  234. <section3 topic='Registered Values' anchor='registrar-altconn-values'>
  235. <p>This document registers the following values.</p>
  236. <code><![CDATA[
  237. <method>
  238. <name>_xmpp-client-httppoll</name>
  239. <desc>HTTP Polling connection method</desc>
  240. <syntax>
  241. The http: or https: URL at which to contact the HTTP Polling connection manager or proxy
  242. </syntax>
  243. <doc>XEP-0025</doc>
  244. </method>
  245. <method>
  246. <name>_xmpp-client-websocket</name>
  247. <desc>XMPP Over WebSocket connection method</desc>
  248. <syntax>
  249. The ws: or wss: URL at which to contact the WebSocket connection manager or proxy
  250. </syntax>
  251. <doc>RFC 7395</doc>
  252. </method>
  253. <method>
  254. <name>_xmpp-client-xbosh</name>
  255. <desc>XMPP Over Bosh connection method</desc>
  256. <syntax>
  257. The http: or https: URL at which to contact the HTTP Binding (BOSH) connection manager or proxy
  258. </syntax>
  259. <doc>XEP-0206</doc>
  260. </method>
  261. ]]></code>
  262. </section3>
  263. </section2>
  264. </section1>
  265. </xep>