Remove LDAP options

This commit is contained in:
Ludovic Stephan 2020-11-21 17:43:52 +01:00
parent 22c2c6f6f5
commit 975c37afe4

View file

@ -25,16 +25,9 @@ class LDAP:
def __init__(self):
""" Initialize the LDAP object """
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
self.ldap_obj = ldap.initialize(
"{PROTOCOL}://{URL}:{PORT}".format(**self.LDAP_SERVER)
)
self.ldap_obj.set_option(ldap.OPT_REFERRALS, 0)
self.ldap_obj.set_option(ldap.OPT_PROTOCOL_VERSION, 3)
self.ldap_obj.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
self.ldap_obj.set_option(ldap.OPT_X_TLS_DEMAND, True)
self.ldap_obj.set_option(ldap.OPT_NETWORK_TIMEOUT, 10)
self.ldap_obj.set_option(ldap.OPT_TIMEOUT, 10)
def search(self, filters="(objectClass=*)"):
"""Do a ldap.search_s with the given filters, as specified for