X-Git-Url: https://git.proxmox.com/?p=pmg-api.git;a=blobdiff_plain;f=PMG%2FLDAPCache.pm;h=567b5ea75b9ba3575836a8a9b54a7467952a3141;hp=ca4aec98022304842545d3980d3687208a6bc03c;hb=443665c78650c6181b868100915f17c6e0cdbff8;hpb=6ad43a10b97007d94ae6e8d1c02786f04a801ea3 diff --git a/PMG/LDAPCache.pm b/PMG/LDAPCache.pm index ca4aec9..567b5ea 100755 --- a/PMG/LDAPCache.pm +++ b/PMG/LDAPCache.pm @@ -374,6 +374,20 @@ sub ldap_connect_and_bind { my $mesg; + if ($self->{mode} eq 'ldap+starttls') { + my $opts = { + verify => $self->{verify} ? 'require' : 'none', + }; + + if ($self->{cafile}) { + $opts->{cafile} = $self->{cafile}; + } else { + $opts->{capath} = '/etc/ssl/certs/'; + } + + $ldap->start_tls(%$opts); + } + if ($self->{binddn}) { $mesg = $ldap->bind($self->{binddn}, password => $self->{bindpw}); } else {