Added StartTLS functionality

Added StartTLS in function Connect().
And also added parameters in config to activate StartTLS.
This commit is contained in:
S-A-L13 2024-02-22 14:54:55 +01:00
parent 0efc0bbe3a
commit 383e40636b
3 changed files with 18 additions and 0 deletions

View file

@ -178,6 +178,15 @@ class LdapIdentities implements IIdentities
return false;
}
// Activate StartTLS
if ($this->config->starttls) {
$starttlsResult = ldap_start_tls($ldap);
if (!$starttlsResult) {
$this->ldapAvailable = false;
return false;
}
}
$this->ldap = $ldap;
$this->ldapConnected = true;
return true;