Commit f9dbd00f authored by Robin Sonnabend's avatar Robin Sonnabend

Add support for multiple ad hosts

parent 03bbb2fc
......@@ -155,8 +155,16 @@ try:
if ca_cert is not None:
tls_config = ldap3.Tls(
validate=ssl.CERT_REQUIRED, ca_certs_file=ca_cert)
self.server = ldap3.Server(
host, port=port, use_ssl=use_ssl, tls=tls_config)
if isinstance(host, str):
self.server = ldap3.Server(
host, port=port, use_ssl=use_ssl, tls=tls_config)
else:
hosts = host
self.server = ldap3.ServerPool([
ldap3.Server(
host, port=port, use_ssl=use_ssl, tls=tls_config)
for host in hosts
], ldap3.FIRST)
self.domain = domain
self.user_dn = user_dn
self.group_dn = group_dn
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment