1
0
mirror of https://github.com/linkedin/oncall.git synced 2025-11-29 23:38:17 +02:00

Added an IF statement to allow ldap sync when certfile is not specified. Consistent with #171

This commit is contained in:
jeremybender-work
2018-07-03 10:28:39 -05:00
committed by Daniel Wang
parent 28a2ac7b34
commit 47bde5326b

View File

@@ -92,7 +92,8 @@ def prune_user(engine, username):
def fetch_ldap():
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
l = ldap.initialize(LDAP_SETTINGS['url'])
l.set_option(ldap.OPT_X_TLS_CACERTFILE, LDAP_SETTINGS['cert_path'])
if 'cert_path' in LDAP_SETTINGS:
l.set_option(ldap.OPT_X_TLS_CACERTFILE, LDAP_SETTINGS['cert_path'])
l.simple_bind_s(LDAP_SETTINGS['user'], LDAP_SETTINGS['password'])
req_ctrl = SimplePagedResultsControl(True, size=1000, cookie='')