server/sources/ldapuser.py
branchstable
changeset 5407 7730796f9506
parent 5326 0d9054eb3bd1
child 5408 120db445c179
child 5421 8167de96c523
--- a/server/sources/ldapuser.py	Mon Apr 26 11:33:44 2010 +0200
+++ b/server/sources/ldapuser.py	Mon Apr 26 15:28:43 2010 +0200
@@ -67,7 +67,6 @@
           'help': 'ldap protocol (allowed values: ldap, ldaps, ldapi)',
           'group': 'ldap-source', 'inputlevel': 1,
           }),
-
         ('auth-mode',
          {'type' : 'choice',
           'default': 'simple',
@@ -422,6 +421,9 @@
             hostport = self.host
         self.info('connecting %s://%s as %s', self.protocol, hostport,
                   user and user['dn'] or 'anonymous')
+        # don't require server certificate when using ldaps (will
+        # enable self signed certs)
+        ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
         url = LDAPUrl(urlscheme=self.protocol, hostport=hostport)
         conn = ReconnectLDAPObject(url.initializeUrl())
         # Set the protocol version - version 3 is preferred