mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
Auth/ldap, fix for https://github.com/opnsense/core/issues/3206 closes https://github.com/opnsense/core/pull/3217
This commit is contained in:
parent
93ebf02468
commit
12b80b85a8
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user