Ignore:
Timestamp:
Jan 12, 2013, 4:40:38 PM (8 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Properly encode IDN domain names for SRV lookups.

Before Twisted 12.3.0, the SRV lookup done for outgoing
connections succeeded if passed a unicode string with all-ASCII
code points. A recent change made the DNS code more strict, and
only byte string are accepted as domain name. See
http://twistedmatrix.com/trac/ticket/6245 for details.

This change makes sure domain names are encoded to their ASCII
Compatible Equivalent (ACE) version before passing the resulting
byte string to twisted.names.srvconnect.SRVConnector, as per
RFC 3490.

Note that while connecting to servers with an IDN domain name
now works properly, authentication using MD5-Digest SASL mechanism
will fail until http://twistedmatrix.com/trac/ticket/5066 has been
resolved.

Fixes: #77.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/server.py

    r165 r178  
    3030from twisted.words.xish import domish
    3131
    32 from wokkel.generic import DeferredXmlStreamFactory, XmlPipe
     32from wokkel.generic import DeferredXmlStreamFactory, XmlPipe, prepareIDNName
    3333
    3434NS_DIALBACK = 'jabber:server:dialback'
     
    469469
    470470def initiateS2S(factory):
    471     domain = factory.authenticator.otherHost
     471    domain = prepareIDNName(factory.authenticator.otherHost)
    472472    c = XMPPServerConnector(reactor, domain, factory)
    473473    c.connect()
Note: See TracChangeset for help on using the changeset viewer.