Comments (6)
Thanks, @donalm ! What LDAP server were you using when trying the quick start example?
It looks like I have broken LDAPSearchResultReference
while porting the code for Python 3. It was not fully implemented before but certainly did not raise exceptions.
from ldaptor.
ActiveDirectory is providing our LDAP service. Thanks for looking at this @GrayAn
from ldaptor.
Also (maybe): ldaptor/protocols/pureldap.py
:
1503c1503
< oid = b'1.3.6.1.4.1.1466.20037'
---
> oid = '1.3.6.1.4.1.1466.20037'
1528c1528
< oid = b'1.3.6.1.4.1.1466.20037'
---
> oid = '1.3.6.1.4.1.1466.20037'
Sorry to just dump this diff in here and run. I'll do some isolation testing with this and update the ticket.
UPDATE: I'm seeing this problem only in my Python 3 environment. When I add client.startTLS()
after the connect call:
client = yield c.connect(basedn, overrides=overrides)
client.startTLS()
I get this ldaptor.protocols.ldap.ldapclient.LDAPStartTLSInvalidResponseName
exception:
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/python/reflect.py:448: DeprecationWarning: LDAPStartTLSInvalidResponseName.__str__ method is deprecated and will not be used for getting bytes representation in the future releases, use LDAPStartTLSInvalidResponseName.toWire instead
return str(o)
/opt/pipeline/python3/lib/python3.6/traceback.py:151: DeprecationWarning: LDAPStartTLSInvalidResponseName.__str__ method is deprecated and will not be used for getting bytes representation in the future releases, use LDAPStartTLSInvalidResponseName.toWire instead
return str(value)
[Failure instance: Traceback: <class 'ldaptor.protocols.ldap.ldapclient.LDAPStartTLSInvalidResponseName'>: <LDAPStartTLSInvalidResponseName instance at 0x7fb844bc6a68 with str error:
Traceback (most recent call last):
File "/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/mnt/software/dev/dmcmullan/ldap_test/bin/py/minimal3.py", line 16, in example
client = yield client.startTLS()
File "/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/scratch/geek/ldaptor/ldaptor/protocols/ldap/ldapclient.py", line 256, in _cbStartTLS
raise LDAPStartTLSInvalidResponseName(msg.responseName)
ldaptor.protocols.ldap.ldapclient.LDAPStartTLSInvalidResponseName: <unprintable LDAPStartTLSInvalidResponseName object>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/python/reflect.py", line 448, in safe_str
return str(o)
TypeError: __str__ returned non-string (type bytes)
>
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:460:callback
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:1475:gotResult
--- <exception caught here> ---
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/python/failure.py:491:throwExceptionIntoGenerator
/mnt/software/dev/dmcmullan/ldap_test/bin/py/minimal3.py:16:example
/mnt/software/dev/dmcmullan/ldap_test/bin/v3/lib/python3.6/site-packages/twisted/internet/defer.py:654:_runCallbacks
/scratch/geek/ldaptor/ldaptor/protocols/ldap/ldapclient.py:256:_cbStartTLS
]
The code works fine in Python 2. The diff I pasted above suppresses the error in Python 3.
Thanks again @GrayAn
from ldaptor.
@donalm - If I want to test a patch for the SearchResultReference issue, I have access to an AD environment, but I don't really know much about administering it. Is there some kind of explicit reference I can create in the directory that I can query for testing?
from ldaptor.
I hope you won't need to jump through too many hoops - the filterText that I'm using is just:
([email protected])
...to return the directory info for one user.
(I also don't administer the AD instance - I just query it).
from ldaptor.
@donalm Maybe you can try to test the latest changes against your AD instance? You can use this branch for it: startTLS, LDAPSearchResultReference
and exception issues were fixed in it.
from ldaptor.
Related Issues (20)
- failing checks on master still HOT 5
- BerOctetString Repr HOT 1
- TCP Connection not closed if non SSL ldaptor LDAPServer accessed via SSL HOT 1
- missing tag for 19.1.0 HOT 1
- Proxy unable to connect to Active Directory HOT 2
- enable PR builds for readthedocs HOT 7
- release 20.1.1 ? HOT 1
- Help: how to modify ldap filter within handleBeforeForwardRequest HOT 2
- Bug: ModifyOp in the Delta module cannot serialize from LDAP
- Add callback/hook when the client connection is closed
- Merger example - Connection lost
- `SearchByTreeWalkungMixin` ignores `sizeLimit`
- LdapServer: getRootDSE misses some required attributes HOT 1
- VLV support in ldaptor HOT 1
- Reload LDIF during serving HOT 1
- Testing with Twisted 22.4 results in infinite loop creating temporary config files
- Intended handling of UnknownBERTag?
- LDAP server with binary transfer attribute for userCertificate (RFC 4522/RFC 4523)
- Remove print usage in production code
- I can't connect to the server through sssd
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldaptor.