LDAP: Throw an exception if Start TLS fails
This ensures that only a secure connection to the LDAP server will be used, if Start TLS has been enabled. Signed-off-by: Jarkko Lehtoranta <devel@jlranta.com>
This commit is contained in:
parent
ee2c6e8215
commit
de9a9bc004
|
@ -586,7 +586,9 @@ class Connection extends LDAPUtility {
|
|||
if($this->ldap->setOption($this->ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) {
|
||||
if($this->ldap->setOption($this->ldapConnectionRes, LDAP_OPT_REFERRALS, 0)) {
|
||||
if($this->configuration->ldapTLS) {
|
||||
$this->ldap->startTls($this->ldapConnectionRes);
|
||||
if(!$this->ldap->startTls($this->ldapConnectionRes)) {
|
||||
throw new \OC\ServerNotAvailableException('Start TLS failed, when connecting to LDAP host ' . $host . '.');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue