XSF Discussion - 2021-05-24


  1. moparisthebest

    Wait a second, I was told a single monolithic spec avoided this: > The Conduit Matrix server (although not yet feature complete) is about 100x lighter on CPU than the server that runs matrix.org. > The developer is now being funded to work on it full time. It's usable for private non-federated servers already (federation is not advised currently, because it is unearthing spec non-compliance issues in various other Matrix servers and clients), which have not yet been fixed.

  2. mdosch

    Did you ever use xmpp.com? Searx lead me to https://www.xmpp.com/extensions/xep-0371.html but the cert is invalid.

  3. qrpnxz

    are there any de facto standard ports for xmpps? Or just some common ones that you suggest?

  4. Menel

    The standard is 5222 for client and 5269 for server. These ports every server and client will try automatically.

  5. Menel

    The standard is 5222 for client and 5269 for server to server. These ports every server and client will try automatically.

  6. qrpnxz

    for xmpps

  7. qrpnxz

    not xmpp

  8. Menel

    Ah, overread that.

  9. qrpnxz

    np easy to miss

  10. Menel

    I think its not really standardized, but maybe someone will correct me. People use 5223. You just advertise it where you want.

  11. qrpnxz

    so for i've only found one server with an xmpps record

  12. Menel

    Many have them

  13. qrpnxz

    yeah 404.city has _xmpps-client on 5223

  14. Menel

    https://compliance.conversations.im/old/

  15. Menel

    Everyone that is green for srv for tls

  16. qrpnxz

    looks like xmpp.jp has both xmpp and xmpps on 5269 for server. I wonder how they do that. Try a handshake and if it fails try a normal connection? Seems like a waste of time lol

  17. qrpnxz

    thx for list

  18. qrpnxz

    ah that might not be that bad tbh. Maybe i'll do that we'll see

  19. qrpnxz

    i think you actually know if it's trying to be TLS or XML on the first byte even

  20. Menel

    Doesn't really matter, since non other server supports it

  21. Menel

    Direct TLS is for c2s

  22. qrpnxz

    haha no

  23. şişio

    XMPP really good and safe

  24. şişio

    I like it

  25. şişio

    aTalk fdroid app hasnt got new aTalk version

  26. şişio

    I writed

  27. eevvoor

    I never heard of the aTalk App. Who is the dev behind it`?

  28. eevvoor

    I never heard of the aTalk App. Who is the dev behind it?

  29. mdosch

    https://github.com/cmeng-git/atalk-android

  30. şişio

    > https://github.com/cmeng-git/atalk-android How do I download it?

  31. mdosch

    Usually you won't build it yourself but install it from Google Play or Fdroid.

  32. şişio

    > Usually you won't build it yourself but install it from Google Play or Fdroid. Fdroid doesn't have a new version

  33. Menel

    Fdroid has problems to build it, it seems nit easy to get it right with the dependencys

  34. şişio

    Hmm okay

  35. moparisthebest

    qrpnxz, xep-368 direct tls is most valuable on port 443 due to crap firewalls, the most popular way servers multiplex is with sslh or nginx or something https://wiki.xmpp.org/web/Tech_pages/XEP-0368

  36. qrpnxz

    agreed

  37. moparisthebest

    I even suggest ignoring spec and hard-coding 443 as the fallback default for it , just don't tell certain people or they'll have a heart attack https://github.com/moparisthebest/xmpp-proxy/blob/master/src/srv.rs#L122

  38. Zash

    Depending on your socket and TLS library, you can check if the first byte is '<' or \27 (iirc) and decide plain/direct tls on that

  39. Zash throws things at moparisthebest

  40. moparisthebest ducks like a ninja

  41. qrpnxz

    checking for < is too risk, I would just check for w/e magic byte tls uses, and if it's not that then start trying to parse xml

  42. moparisthebest

    qrpnxz, I check first 3 bytes to decide TLS or not https://github.com/moparisthebest/xmpp-proxy/blob/master/src/tls.rs#L145

  43. moparisthebest

    it probably is fine to just check if the first is 0x16

  44. Zash

    moparisthebest: Good job. You crashed my Dino 🙁

  45. Zash

    Some byte followed by two bytes representing the SSL version

  46. qrpnxz

    moparisthebest, 0x16 is already not valid xml, so i'd try tls just based on that

  47. moparisthebest

    yes, I'll probably change it

  48. qrpnxz

    and not that i'm super against checking a couple more bytes, but in Go it's gonna be trivial to unread one byte, but not anymore than that.

  49. qrpnxz

    in rust idk

  50. qrpnxz

    lol thx for putting the rfc and section in the comments, i've been doing that as well xD

  51. moparisthebest

    yea if you scroll up a bit you'll see that I discovered it's almost impossible to read > 1 in rust too, and I resorted to hacks, and lamented that I should probably only check 0x16 only :P

  52. Sam

    I'm assuming you're using bufio in which case it's trivial to do either

  53. Sam

    but 1 byte is good enough either way

  54. qrpnxz

    bufio can only unread one byte

  55. qrpnxz

    ah but you can peek more than that

  56. Sam

    https://pkg.go.dev/bufio#Reader.Peek

  57. qrpnxz

    lol

  58. moparisthebest

    be carefuly though, looks similar to rust's API and it'll let you just spin forever waiting for 3 bytes that'll never come

  59. qrpnxz

    no worries i'm using timeouts

  60. qrpnxz

    but thx

  61. Sam

    yah, the read will indeed spin, but if you haven't set timeouts that's a problem either way

  62. qrpnxz

    you could also not have xmpp and xmpps on the same port then you don't have to this check :)

  63. qrpnxz

    it'd be interesting to have both a webpage and xmpp server on the same port tho. I don't know how HTTP/2 requests start however

  64. Zash

    ALPN?

  65. qrpnxz

    alpn gives away it's xmpp

  66. Zash

    I thought we had arrived in the promised land of encrypted handshakes?

  67. qrpnxz

    best not to use HTTP/2 actually. ``` implementations that support HTTP/2 over TLS MUST use protocol negotiation in TLS [TLS-ALPN]. ``` And if ALPN is used, XEP-0368 says to set it for xmpp.

  68. qrpnxz

    so you'd wanna do http 1.1, check that request looks like an http request or not, if it doesn't you start parsing xml.

  69. qrpnxz

    first 3-4 bytes should suffice for the request method

  70. Zash

    Uppercase ASCII letter

  71. Zash

    IIRC

  72. qrpnxz

    i'll check but probably

  73. Zash

    Prosodys mod_net_multiplex does ^[A-Z] → http for example.

  74. Holger

    > so you'd wanna do http 1.1, check that request looks like an http request or not, if it doesn't you start parsing xml. After decades of developing Internet technology, we ended up with pure elegance.

  75. qrpnxz

    😁️

  76. Kev

    Isn’t checking for < sufficient to know it’s XML?

  77. qrpnxz

    Honestly doing [GHPDCOT] on the first byte should be good enough

  78. Kev

    Whether you preamble or not, that’ll be the first char.

  79. qrpnxz

    Kev, no because it doesn't have to start like that

  80. qrpnxz

    it could start with whitespace

  81. Kev

    We allow that?

  82. qrpnxz

    i can recheck

  83. Zash

    HTCPCP?

  84. qrpnxz

    but afaik yes

  85. Kev

    I had in my head that we didn’t, for some reason.

  86. qrpnxz

    yeah i don't see any such restriction, but if you find it let me know

  87. Zash

    Whitespace before `<?xml?>` is forbidden, I think. Expat rejects it at least.

  88. qrpnxz

    ik other parser don't but that you SHOULD put it at the start for file type detection

  89. Zash

    Seems to be just fine with whitespace before `<stream:stream ...` tho

  90. Zash

    The multiplex thing checks for a bunch more anyways

  91. qrpnxz

    oh that's nice, XML 1.1 actually requires the xml decl. XML 1.0 only recommends it

  92. Zash

    XMPP is XML 1.0 tho

  93. moparisthebest

    qrpnxz: don't forget SNI which you can abuse too, all of my TLS services work over port 443 using sslh

  94. qrpnxz

    SNI?

  95. Zash

    Personally it feels extremely redundant, since XMPP is always XML and UTF-8 and I think everything else you can say with <?xml?> is forbidden

  96. qrpnxz

    xmpp might not always use xml 1.0

  97. Zash

    Server Name Indication, what the HTTP world invented instead of telling which host (and thus cert) is expected prior to TLS.

  98. Sam

    it will because almost no one implements 1.1 and at this point no one ever will

  99. moparisthebest

    qrpnxz, like imap.example.org goes to dovecot and smtp.example.org goes to postfix etc etc

  100. qrpnxz

    i plan to, it's not that different either, just adds internationalization stuff

  101. moparisthebest

    and there is no negotiation for xml 1.1 meaning... it'll never happen

  102. Zash

    Wouldn't the "modern" way be to add some ALPN XMPP 2.0 thing then? (not serious, but if it happens it'll probably turn out something like that)

  103. Sam

    Negotiation would be "what decl does the client send?" no?

  104. Sam

    not that it matters, just cirious

  105. Sam

    curious too

  106. moparisthebest

    sure, but then what, you've got client1 <-> server1 <-> server2 <-> client2 and each of those 3 links can be XML 1.0 or 1.1 now ? do the servers automagically convert or... what's the advantage

  107. qrpnxz

    hmm, actually xml 1.1 is not just internalization. Looking at the grammar to answer the whitespace question, it actually cleans up some other crap in the standard. Btw, if there is an xmldecl, it indeed has to be the very first thing in the document. If we were using xml 1.1 which requires the xmldecl, that means that you would indeed reliable detect an xml document.

  108. qrpnxz

    i guess you could check for `<?xml ` then sometimes you'd know for sure if it's XML, but not always.

  109. qrpnxz

    > I think everything else you can say with <?xml?> is forbidden Zash, you're also allowed to say `standalone="yes"` :)

  110. Zash

    What sense does that make in XMPP?

  111. qrpnxz

    it must be a standalone document for xmpp, so you aren't allowed to say `standalone="no"`

  112. Zash

    So what's the point?

  113. Zash

    Explicit > implicit?

  114. qrpnxz

    just informing you there's one more thing that's not forbidden :)

  115. Zash

    My point is that there's a bunch of things you can say where you only have one choice, where saying nothing means the same thing.

  116. Zash

    Which makes it feel like a waste of bytes.

  117. qrpnxz

    ah yeah i wouldn't bother sending encoding or standalone attributes

  118. qrpnxz

    i'd send xmldecl to help detection tho

  119. toutafait

    > mdosch wrote: > https://github.com/cmeng-git/atalk-android is it better than conversation/blabber?

  120. toutafait

    better being "to have more features"

  121. toutafait

    better meaning: "to have more features"

  122. Zash

    Try it and compare?

  123. toutafait

    old version on fdroid

  124. eta

    I found the XMPP tunnel

  125. eta

    https://theta.eu.org/xmpp/upload/GQEMe1jq_9IuZ66Q/cStIxtEhQbyjL98TA7nudg.jpg

  126. şişio

    Test

  127. şişio

    Good

  128. şişio

    If I add myself, I'll have a notebook.

  129. şişio

    Right?

  130. şişio

    No one can see

  131. moparisthebest

    your server admin, unless you encrypt

  132. eevvoor

    Gajim does not allow me to add myself to my own roster. Or the Server does not allow this.

  133. wurstsalat

    eevvoor, if you have 2+ devices online, gajim shows your own contact (but that's buggy at the moment). 1.4 will have this more prominent

  134. Zash

    Forbidden by some specification or something

  135. Zash

    Or was it hysterical raisins?

  136. eevvoor

    wurstsalat, it does work for me without bugs. I meant the ecact same jid does not work. ;-)

  137. eevvoor

    wurstsalat, it does work for me without bugs. I meant the exact same jid does not work. ;-)

  138. Zash

    You're already implicitly subscribed to your own presence tho

  139. eevvoor

    yeay but şişio‎ asked for "writing" to yourself, not mere presence

  140. eevvoor

    yeay but şişio‎ asked for "writing" to yourself, not mere presence

  141. Zash

    Don't need presence or roster entry to write to anyone, especially not yourself

  142. şişio

    > moparisthebest wrote: > your server admin, unless you encrypt How? I dont understand

  143. moparisthebest

    omemo, pgp etc

  144. moparisthebest

    I send myself messages all the time

  145. şişio

    If I encrypt it, no one can see it, so there'll be a notebook.

  146. şişio

    > I wrote: > If I encrypt it, no one can see it, so there'll be a notebook. Right?

  147. eevvoor

    yes şişio‎

  148. şişio

    I can't get old messages in new session on Xmpp

  149. şişio

    Test

  150. eevvoor

    that is normal şişio‎.

  151. eevvoor

    Only new messages will be received.