ldap3 icon indicating copy to clipboard operation
ldap3 copied to clipboard

v2.9.1: moved from centos 7 to centos stream 9, now getting LDAPSocketOpenError: invalid server address

Open shorton3 opened this issue 3 years ago • 1 comments

I have moved my code that uses ldap v2.9.1 from centos 7 (where it is working) to centos stream 9, and now I am getting LDAPSocketOpenError: invalid server address. Nothing in my code has changed; in summary, it uses NTLM like this:

server = 'ldap://x.ad.company.com' userName = "x.ad.company.com\user" passwordString = "a_password" base_dn = 'DC=x,DC=ad,DC=company,DC=com' ldap3_client = Server(server, get_info=ALL) search_filter='(&(objectClass=person)(samaccountname=user))' attributes=['cn','memberOf'] try: with Connection(ldap3_client, user=userName, password=passwordString, auto_bind=True, authentication=NTLM) as conn: conn.search(base_dn, search_filter, search_scope=SUBTREE, get_operational_attributes=True, attributes=attributes) except LDAPBindError:

Any ideas why my code using 2.9.1 would work on centos7, but not on centos stream 9? Thanks

shorton3 avatar Feb 17 '22 14:02 shorton3

Traceback (most recent call last): File "/home/centos/./ldap_test.ldap3.py", line 33, in with Connection(ldap3_client, user=userName, password=passwordString, authentication=NTLM) as conn: File "/opt/python3-virtualenv/lib64/python3.9/site-packages/ldap3/core/connection.py", line 538, in enter self.open() File "/opt/python3-virtualenv/lib64/python3.9/site-packages/ldap3/strategy/sync.py", line 57, in open BaseStrategy.open(self, reset_usage, read_server_info) File "/opt/python3-virtualenv/lib64/python3.9/site-packages/ldap3/strategy/base.py", line 154, in open raise LDAPSocketOpenError('invalid server address') ldap3.core.exceptions.LDAPSocketOpenError: invalid server address

shorton3 avatar Feb 17 '22 23:02 shorton3