1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Change to allow override of CA CERT for LDAPS

Using the env LDAP_TLS_CACERTFILE to set a file to use to override
the CA CERT used to verify LDAPS connections. This is to make this
process easier for docker use.
This commit is contained in:
Matt Moore
2024-03-26 16:30:04 +00:00
parent 6c063f424c
commit 06ef95dc5f
2 changed files with 7 additions and 0 deletions

View File

@@ -209,6 +209,12 @@ class LdapService
$this->ldap->setOption(null, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_NEVER);
}
// Specify CA Cert file for LDAP.
// This option works globally and must be set before a connection is created.
if ($this->config['tls_cacertfile']) {
$this->ldap->setOption(null, LDAP_OPT_X_TLS_CACERTFILE, $this->config['tls_cacertfile']);
}
$ldapHost = $this->parseServerString($this->config['server']);
$ldapConnection = $this->ldap->connect($ldapHost);