Use keepalive for LDAP connections (#2344)
This commit is contained in:
parent
ca97628c04
commit
fcb8e6b3c5
|
@ -91,8 +91,9 @@ sub ldap {
|
|||
# Connect
|
||||
my $ldap = Net::LDAP->new(
|
||||
\@servers,
|
||||
onerror => undef,
|
||||
verify => ( $self->{ldapVerify} || "require" ),
|
||||
keepalive => 1,
|
||||
onerror => undef,
|
||||
verify => ( $self->{ldapVerify} || "require" ),
|
||||
( $self->{ldapCAFile} ? ( cafile => $self->{ldapCAFile} ) : () ),
|
||||
( $self->{ldapCAPath} ? ( capath => $self->{ldapCAPath} ) : () ),
|
||||
( $self->{ldapPort} ? ( port => $self->{ldapPort} ) : () ),
|
||||
|
|
|
@ -486,7 +486,8 @@ sub _ldap {
|
|||
# Connect
|
||||
my $ldap = Net::LDAP->new(
|
||||
\@servers,
|
||||
onerror => undef,
|
||||
onerror => undef,
|
||||
keepalive => 1,
|
||||
( $self->ldapPort ? ( port => $self->ldapPort ) : () ),
|
||||
( $self->ldapVerify ? ( verify => $self->ldapVerify ) : () ),
|
||||
( $self->ldapCAFile ? ( cafile => $self->ldapCAFile ) : () ),
|
||||
|
|
|
@ -47,7 +47,8 @@ sub new {
|
|||
}
|
||||
$self = Net::LDAP->new(
|
||||
\@servers,
|
||||
onerror => undef,
|
||||
onerror => undef,
|
||||
keepalive => 1,
|
||||
( $conf->{ldapPort} ? ( port => $conf->{ldapPort} ) : () ),
|
||||
( $conf->{ldapTimeout} ? ( timeout => $conf->{ldapTimeout} ) : () ),
|
||||
( $conf->{ldapVersion} ? ( version => $conf->{ldapVersion} ) : () ),
|
||||
|
@ -66,7 +67,7 @@ sub new {
|
|||
# socket when certificate validation fails. Net::LDAP does not catch
|
||||
# it, and the process ends up crashing.
|
||||
# As a precaution, make sure the underlying socket is doing fine:
|
||||
if ( $self->socket->isa('IO::Socket::SSL')
|
||||
if ( $self->socket->isa('IO::Socket::SSL')
|
||||
and $self->socket->errstr < 0 )
|
||||
{
|
||||
$portal->logger->error(
|
||||
|
|
Loading…
Reference in New Issue
Block a user