From a7f27dd4322e1a28f594ce8f276c7da70ee9cd45 Mon Sep 17 00:00:00 2001 From: svan42 <> Date: Tue, 18 Mar 2025 15:30:10 +0100 Subject: [PATCH] Support multiple LDAP servers for better fault tolerance --- lib/Connector/Proxy/Net/LDAP.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Connector/Proxy/Net/LDAP.pm b/lib/Connector/Proxy/Net/LDAP.pm index 11be1cd..1d4dd20 100644 --- a/lib/Connector/Proxy/Net/LDAP.pm +++ b/lib/Connector/Proxy/Net/LDAP.pm @@ -279,8 +279,10 @@ sub _init_bind { $self->log()->debug('Open bind to to ' . $self->LOCATION()); + # LOCATION might contain multiple LDAP URI or hosts. We have to pass them as a array ref to Net::LDAP->new(). + my @ldap_locations = split(',', $self->LOCATION()); my $ldap = Net::LDAP->new( - $self->LOCATION(), + \@ldap_locations, $self->_build_new_options(), );