summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-12-13 17:52:19 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-01-14 16:32:55 +0100
commite4b7c6ef1048b3a941abba19f867221350700e11 (patch)
tree83b55ff3dff7e95220cb98e626e6b81e00ac64fa /apps
parentc3a0b0d7f3564ff7a8b80b5b375ea10f31282b8a (diff)
downloadnextcloud-server-e4b7c6ef1048b3a941abba19f867221350700e11.tar.gz
nextcloud-server-e4b7c6ef1048b3a941abba19f867221350700e11.zip
LDAP: fix TLS detection
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/wizard.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 348a871e2b3..9de203b2b2d 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -795,7 +795,10 @@ class Wizard extends LDAPUtility {
$a = $this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
$c = $this->ldap->setOption($cr, LDAP_OPT_NETWORK_TIMEOUT, self::LDAP_NW_TIMEOUT);
if($tls) {
- $this->ldap->startTls($cr);
+ $isTlsWorking = @$this->ldap->startTls($cr);
+ if(!$isTlsWorking) {
+ return false;
+ }
}
\OCP\Util::writeLog('user_ldap', 'Wiz: Attemping to Bind ', \OCP\Util::DEBUG);
@@ -809,7 +812,7 @@ class Wizard extends LDAPUtility {
if($ncc) {
throw new \Exception('Certificate cannot be validated.');
}
- \OCP\Util::writeLog('user_ldap', 'Wiz: Bind succesfull with Port '. $port, \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'Wiz: Bind succesfull with Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG);
return true;
}