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-0368.xml 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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>SRV records for XMPP over TLS</title>
  10. <abstract>This specification defines a procedure to look up xmpps-client/xmpps-server SRV records (for direct TLS connections) in addition to xmpp-client/xmpp-server and mix weights/priorities.</abstract>
  11. &LEGALNOTICE;
  12. <number>0368</number>
  13. <status>Draft</status>
  14. <lastcall>2017-02-22</lastcall>
  15. <lastcall>2017-02-11</lastcall>
  16. <type>Standards Track</type>
  17. <sig>Standards</sig>
  18. <approver>Council</approver>
  19. <dependencies>
  20. <spec>XMPP Core</spec>
  21. <spec>RFC 2782</spec>
  22. </dependencies>
  23. <supersedes/>
  24. <supersededby/>
  25. <shortname>NOT_YET_ASSIGNED</shortname>
  26. <author>
  27. <firstname>Travis</firstname>
  28. <surname>Burtrum</surname>
  29. <email>travis@burtrum.org</email>
  30. <jid>travis@burtrum.org</jid>
  31. </author>
  32. <revision>
  33. <version>1.0.0</version>
  34. <date>2017-03-09</date>
  35. <initials>XEP Editor (ssw)</initials>
  36. <remark><p>Advance to draft as approved by the XMPP Council.</p></remark>
  37. </revision>
  38. <revision>
  39. <version>0.1.2</version>
  40. <date>2017-02-15</date>
  41. <initials>tjb</initials>
  42. <remark><p>Implement more last call comments, editorial changes, mixing SRV records is now SHOULD.</p></remark>
  43. </revision>
  44. <revision>
  45. <version>0.1.1</version>
  46. <date>2017-02-06</date>
  47. <initials>tjb</initials>
  48. <remark><p>Implement last call comments, editorial changes, SNI is now MUST.</p></remark>
  49. </revision>
  50. <revision>
  51. <version>0.1</version>
  52. <date>2015-12-15</date>
  53. <initials>XEP Editor (asw)</initials>
  54. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  55. </revision>
  56. <revision>
  57. <version>0.0.2</version>
  58. <date>2015-12-15</date>
  59. <initials>tjb</initials>
  60. <remark><p>tls proto to tcp, change service instead. Set SNI correctly.</p></remark>
  61. </revision>
  62. <revision>
  63. <version>0.0.1</version>
  64. <date>2015-10-31</date>
  65. <initials>psa</initials>
  66. <remark><p>First draft.</p></remark>
  67. </revision>
  68. </header>
  69. <section1 topic='Introduction' anchor='intro'>
  70. <p>&xmppcore; specifies the use of xmpp-client/xmpp-server SRV records as the method of discovering how to connect to an XMPP server. This XEP extends that to include new xmpps-client/xmpps-server SRV records pointing to direct TLS ports and combine priorities and weights as if they were a single SRV record similar to &rfc6186;. It also provides an easy way for clients to bypass restrictive firewalls that only allow HTTPS, for servers to host multiple protocols/services on a single port, and for servers and clients to take advantage of less round trips and existing direct TLS loadbalancers.</p>
  71. </section1>
  72. <section1 topic='Glossary' anchor='glossary'>
  73. <dl>
  74. <di>
  75. <dt>Direct TLS</dt>
  76. <dd>
  77. Where TLS is attempted immediately on connect to a TCP socket, like how HTTPS works, not like how STARTTLS works with any protocol.
  78. </dd>
  79. </di>
  80. </dl>
  81. </section1>
  82. <section1 topic='Requirements' anchor='reqs'>
  83. <p>The following format for DNS SRV resource records is specified in &rfc2782;:</p>
  84. <code><![CDATA[
  85. _service._proto.name. TTL class SRV priority weight port target.
  86. ]]></code>
  87. <p>&xmppcore; defines SRV records only where 'service' is 'xmpp-client' and 'xmpp-server'. This document specifies to additionally look up records where 'service' is 'xmpps-client' and 'xmpps-server'. This document specifies that the following additional rules apply:</p>
  88. <ol>
  89. <li>Both 'xmpp-' and 'xmpps-' records SHOULD be treated as the same record with regard to connection order as specified by &rfc2782;, in that all priorities and weights are mixed. This enables the server operator to decide if they would rather clients connect with STARTTLS or direct TLS. However, clients MAY choose to prefer one type of connection over the other.</li>
  90. <li>Where 'service' starts with 'xmpps-' the client or server MUST connect with direct TLS enabled.</li>
  91. <li>Where 'service' starts with 'xmpp-' the client or server MUST NOT connect with direct TLS enabled, connection method is unchanged from &xmppcore;.</li>
  92. <li>TLS certificates MUST be validated the same way as for STARTTLS. (i.e., as specified in &xmppcore;).</li>
  93. <li>STARTTLS MUST NOT be used over direct TLS connections.</li>
  94. <li>Client or server MUST set SNI TLS extension to the JID's domain part.</li>
  95. <li>Client or server SHOULD set the ALPN (&rfc7301;) TLS extension.</li>
  96. <li>When ALPN is used, the ALPN protocol MUST be '<strong>xmpp-client</strong>', where the SRV service is '<strong>xmpps-client</strong>'.</li>
  97. <li>When ALPN is used, the ALPN protocol MUST be '<strong>xmpp-server</strong>', where the SRV service is '<strong>xmpps-server</strong>'.</li>
  98. </ol>
  99. </section1>
  100. <section1 topic='Use Cases' anchor='usecases'>
  101. <p>For server operators, this provides a way to host multiple services on the same port, especially when SNI or ALPN extensions are used. Servers could even host xmpp-client and xmpp-server services on the same TLS port. For clients, this provides a virtually zero overhead way to bypass restrictive firewalls that only allow HTTP over port 80 and HTTPS over port 443, as XMPP-over-TLS is indistinguishable from HTTP-over-TLS when ALPN is not used. For clients and servers, direct TLS saves round trips vs STARTTLS.</p>
  102. </section1>
  103. <section1 topic='Implementation Notes' anchor='impl'>
  104. <p>The only overhead is the single additional SRV lookup. All clients that support STARTTLS already have support for direct TLS.</p>
  105. <p>Server operators should not expect multiplexing (via ALPN) to work in all scenarios and therefore should provide additional SRV record(s) that do not require multiplexing (either standard STARTTLS or dedicated direct XMPP-over-TLS). This is a result of relying on ALPN for multiplexing, where ALPN might not be supported by all devices or may be disabled by a user due to privacy reasons.</p>
  106. </section1>
  107. <section1 topic='Security Considerations' anchor='security'>
  108. <p>Direct TLS provides AT LEAST the same level of security as STARTTLS, and more privacy without ALPN as using STARTTLS leaks that the underlying protocol is XMPP, while any direct TLS stream should be indistinguishable from any other direct TLS stream. Direct TLS provides more security than STARTTLS if &rfc7590; is not followed, as it isn't subject to STARTTLS stripping. All security setup and certificate validation code SHOULD be shared between the STARTTLS and direct TLS logic as well. All SRV-based connection methods are subject to DNS modification/stripping/spoofing of SRV records in the absence of DNSSEC.</p>
  109. </section1>
  110. <section1 topic='IANA Considerations' anchor='iana'>
  111. <p>ALPN (&rfc7301;) requires registration of new Protocol IDs. This document specifies two Protocol IDs:</p>
  112. <p>
  113. Protocol: XMPP jabber:client namespace<br/>
  114. Identification Sequence:<br/>
  115. &nbsp;&nbsp;&nbsp;0x78 0x6d 0x70 0x70 0x2d 0x63 0x6c 0x69 0x65 0x6e 0x74 ("xmpp-client")<br/>
  116. Reference: [&xep0368;]
  117. </p>
  118. <p>
  119. Protocol: XMPP jabber:server namespace<br/>
  120. Identification Sequence:<br/>
  121. &nbsp;&nbsp;&nbsp;0x78 0x6d 0x70 0x70 0x2d 0x73 0x65 0x72 0x76 0x65 0x72 ("xmpp-server")<br/>
  122. Reference: [&xep0368;]
  123. </p>
  124. <p>The ALPN registry is currently located <link url='https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids'>here</link>.</p>
  125. <p>Issues with direct TLS ports mentioned in &rfc2595; <link url='https://tools.ietf.org/html/rfc2595#section-7'>Section 7</link> do not apply here for these reasons:</p>
  126. <ol>
  127. <li>URL scheme is unchanged.</li>
  128. <li>"Security" is the same between STARTTLS and direct TLS, and post-2014 the general consensus is that no public XMPP server or client should connect without some form of TLS per the <link url='https://github.com/stpeter/manifesto/blob/master/manifesto.txt'>ubiquitous encryption manifesto</link>.</li>
  129. <li>A "Use TLS when available" security model is possible here because the client could fall back to standard STARTTLS SRV records if the server administrator supplies them.</li>
  130. <li>No port numbers are assigned because SRV allows using arbitrary ports at the server administrator's discretion.</li>
  131. </ol>
  132. </section1>
  133. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  134. <p>This document requires no interaction with the &REGISTRAR;.</p>
  135. </section1>
  136. </xep>