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/client.py

    r96 r178  
    8888    def __init__(self, jid, password, host=None, port=5222):
    8989        self.jid = jid
    90         self.domain = jid.host
     90        self.domain = generic.prepareIDNName(jid.host)
    9191        self.host = host
    9292        self.port = port
     
    183183
    184184def clientCreator(factory):
    185     domain = factory.authenticator.jid.host
     185    domain = generic.prepareIDNName(factory.authenticator.jid.host)
    186186    c = XMPPClientConnector(reactor, domain, factory)
    187187    c.connect()
Note: See TracChangeset for help on using the changeset viewer.