Ad Schellevis 2019-02-11 08:46:55 +01:00
parent 93ebf02468
commit 12b80b85a8

View File

@ -278,17 +278,16 @@ class LDAP extends Base implements IAuthConnector
if (isset(Config::getInstance()->object()->ca)) {
foreach (Config::getInstance()->object()->ca as $cert) {
if (isset($cert->refid) && (string)$caref == $cert->refid) {
$this->ldapCAcert = $cert->refid;
$this->ldapCAcert = (string)$cert->refid;
@mkdir("/var/run/certs");
@unlink("/var/run/certs/{$this->ldapCAcert}.ca");
file_put_contents("/var/run/certs/{$this->ldapCAcert}.ca", base64_decode((string)$cert->crt));
@chmod("/var/run/certs/{$this->ldapCAcert}.ca", 0644);
break;
}
}
}
if (!empty($this->ldapCAcert)) {
@mkdir("/var/run/certs");
@unlink("/var/run/certs/{$this->ldapCAcert}.ca");
file_put_contents("/var/run/certs/{$this->ldapCAcert}.ca", base64_decode((string)$ca->crt));
@chmod("/var/run/certs/{$this->ldapCAcert}.ca", 0644);
} else {
if (empty($this->ldapCAcert)) {
syslog(LOG_ERR, sprintf('LDAP: Could not lookup CA by reference for host %s.', $caref));
}
}