py-ldap question

L

Laszlo Nagy

Hello,

I'm using the ldap module under Windows. This is the error that I get:

import ldap
l = ldap.initialize("ldaps://neptunus.msnet:636")
l.simple_bind_s("cn=gandalf,ou=Users,dc=neptunus,dc=msnet","gandalf")
l.search_s("ou=AddressBooks,dc=neptunus,dc=msnet", ldap.SCOPE_SUBTREE,
"objectclass=inetOrgPerson")


Traceback (most recent call last):
File
"T:\developer20\knowledgebase\FreeBSD\Thunderbird_OpenLDAP_AddressBook\working\05\example.py",
line 3, in ?
l.simple_bind_s("cn=gandalf,ou=Users,dc=neptunus,dc=msnet","gandalf")
File "C:\Python24\Lib\site-packages\ldap\ldapobject.py", line 175, in
simple_bind_s
msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
File "C:\Python24\Lib\site-packages\ldap\ldapobject.py", line 169, in
simple_bind
return
self._ldap_call(self._l.simple_bind,who,cred,serverctrls,clientctrls)

File "C:\Python24\Lib\site-packages\ldap\ldapobject.py", line 94, in
_ldap_call
result = func(*args,**kwargs)
ldap.SERVER_DOWN: {'info': 'error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', 'desc':
"Can't contact LDAP server"}

I think that I need to specify to the openldap client to trust the
server's certificate. The problem is that the ldap module bundles the
openldap-client implementation, and there is no ldap.conf file (or at
least I cannot find it). So how can I configure it to trust my server's
certificate?

Thanks,

Laszlo
 
?

=?ISO-8859-2?Q?Michael_Str=F6der?=

Laszlo said:
l = ldap.initialize("ldaps://neptunus.msnet:636")
[..]
ldap.SERVER_DOWN: {'info': 'error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', 'desc':
"Can't contact LDAP server"}

I think that I need to specify to the openldap client to trust the
server's certificate.

Better specify which CA certificate to trust with which the server's
cert is then validated by the OpenSSL lib.

See Demo/initialize.py of python-ldap's source distribution:

http://python-ldap.cvs.sourceforge....ap/Demo/initialize.py?content-type=text/plain

Ciao, Michael.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,037
Messages
2,570,371
Members
47,013
Latest member
JewellChes

Latest Threads

Top