I want to connect to a ldap server with python-ldap using a specific baseDN.
import ldap
baseDN="ou=unit,o=org.c=xx" # doesn't work
#baseDN="" # works
host="ldaps://test.org.xx:636"
userDN="cn=proxyhlrb,ou=services,o=org,c=xx"
passwd="secret"
server=ldap.initialize(host+"/"+baseDN)
server.bind_s(userDN,passwd,ldap.AUTH_SIMPLE)
What is wrong here? According to the documentation the argument of ldap.initialize must be a valid LDAP URL according to RFC4516 and therefore using a host+baseDN should work. Is there another way to specify a baseDN in python-ldap?