[Twisted-Python] ldaptor.protocols.ldap.ldapclient.startTLS

Christopher Zorn christopher.zorn at gmail.com
Tue Jun 14 12:58:37 MDT 2005


I hope this is the correct place to ask about this, forgive me if it is not. 

I recently tried to use ldaptor. It is great!! 
I ran into one problem though. I wanted to use startTLS and I had to call 
it myself. 

So I put the following in front of some example code :

d=c.connectAnonymously(config['base'], config['serviceLocationOverrides'])
#d = c.connect(config['base'], config['serviceLocationOverrides'])

    
    def _startTLS(proto):
        d = proto.startTLS()
        d.addCallback(lambda _: proto)
        return d
        

    d.addCallback(_startTLS)


This would hang. I went to find out and there was a deferred created that seemed
to have been getting lost. It was never called when handle was called in the 
client class. 

I attached a patch that allows me to use startTLS the way I did it, but I do not
know if this is correct. Please let me know if I am doing something
wrong or if this
is actually a bug. 

The patch is to the file ldaptor/protocols/ldap/ldapclient.py




More information about the Twisted-Python mailing list