[python-ldap] LDAPS with self-signed certificates

Daniel Corbe daniel at corbe.net
Wed Feb 19 16:24:12 EST 2020


Hi,

I'm trying to connect python-ldap to an LDAP server with a self-signed
SSL certificate and I'm getting the following error.  How do I tell
python-ldap to either ignore or accept a self-signed certificate?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dcorbe/Library/Python/3.7/lib/python/site-packages/ldap/ldapobject.py",
line 445, in simple_bind_s
    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
  File "/Users/dcorbe/Library/Python/3.7/lib/python/site-packages/ldap/ldapobject.py",
line 439, in simple_bind
    return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
  File "/Users/dcorbe/Library/Python/3.7/lib/python/site-packages/ldap/ldapobject.py",
line 331, in _ldap_call
    reraise(exc_type, exc_value, exc_traceback)
  File "/Users/dcorbe/Library/Python/3.7/lib/python/site-packages/ldap/compat.py",
line 44, in reraise
    raise exc_value
  File "/Users/dcorbe/Library/Python/3.7/lib/python/site-packages/ldap/ldapobject.py",
line 315, in _ldap_call
    result = func(*args,**kwargs)
ldap.SERVER_DOWN: {'desc': "Can't contact LDAP server", 'errno': 2,
'info': 'SSLHandshake() failed: misc. bad certificate (-9825)'}


More information about the python-ldap mailing list