disable CERT check stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 26 Apr 2010 15:28:43 +0200
branchstable
changeset 5407 7730796f9506
parent 5406 13d7e220d159
child 5408 120db445c179
child 5410 3cccd5e9dd7d
disable CERT check
server/sources/ldapuser.py
--- 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