[Twisted-Python] ldaptor problem with STARTTLS and python 3

Thomas Westfeld thomas.westfeld at currenta.de
Tue May 28 04:22:10 MDT 2019


Dear all,

I am experiencing an error when trying to use the quick usage example posted on the ldaptor github page https://github.com/twisted/ldaptor . I have included the starttls command to promote the connection to an encrypted one, but I am experiencing an deprecation warning:

DeprecationWarning: LDAPStartTLSInvalidResponseName.__str__ method is deprecated and will not be used for getting bytes representation in the future releases, use LDAPStartTLSInvalidResponseName.toWire instead
  category=DeprecationWarning)

This puzzles me as I cannot track this error down. The usual strategy to introduce debugging print statements or start the debugger like "import pdb; pdb.set_trace()" does not work. I would appreciate help here how to debug this deferred code.

Besides this warning I am receiving no output whatsoever. Also print statements in the example method do not print anything, which is strange to me.

To debug it on a networking level, I have wiresharked the ldap communication and it seems fine (see below):

REQUEST

Transmission Control Protocol, Src Port: 53964, Dst Port: 389, Seq: 1, Ack: 1, Len: 31
Lightweight Directory Access Protocol
    LDAPMessage extendedReq(1)
        messageID: 1
        protocolOp: extendedReq (23)
            extendedReq
                requestName: 1.3.6.1.4.1.1466.20037 (LDAP_START_TLS_OID)
        [Response In: 2587]

RESPONSE

Transmission Control Protocol, Src Port: 389, Dst Port: 53964, Seq: 1, Ack: 32, Len: 46
Lightweight Directory Access Protocol
    LDAPMessage extendedResp(1)
        messageID: 1
        protocolOp: extendedResp (24)
            extendedResp
                resultCode: success (0)
                matchedDN: 
                errorMessage: 
                responseName: 1.3.6.1.4.1.1466.20037 (LDAP_START_TLS_OID)
        [Response To: 2581]
        [Time: 0.245555000 seconds]

I have posted the example code with the starttls command in this gist:

https://gist.github.com/westfeld/bb1d5e8727ce13910623933e041e9782

Thanks for your help!

Best regards,
Thomas


More information about the Twisted-Python mailing list