From 7daa97a166875a9c17d86b609ba3667411ce810d Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 15 Jul 2015 11:31:56 +0200 Subject: [PATCH 1/2] Clean up unneded code Remove the now useless error handling cases in case encryption wasn't successful. refs #9608 --- library/Icinga/Protocol/Ldap/LdapConnection.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index e1cacb7a0..f97b68881 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -340,12 +340,6 @@ class LdapConnection implements Selectable, Inspectable } $this->bound = true; - - if ($this->encryptionSuccess === false && $this->getCapabilities()->hasStartTls()) { - // Alert the user about the unencrypted connection if there is really an error. If the server - // does not support it, don't do anything as authentication is completely broken otherwise. - throw new LdapException('LDAP STARTTLS failed. An error occured. Please see the log for more details'); - } } /** From af58d6964bedb76c45bc7766794ba6a8db2685b1 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 15 Jul 2015 11:46:22 +0200 Subject: [PATCH 2/2] Fix isEncrypted function broken by refactaring refs #9608 --- library/Icinga/Protocol/Ldap/LdapConnection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index f97b68881..099c25006 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -160,7 +160,7 @@ class LdapConnection implements Selectable, Inspectable * * @var bool */ - protected $encryptionSuccess; + protected $encrypted = null; /** * @var array @@ -295,11 +295,11 @@ class LdapConnection implements Selectable, Inspectable */ public function isEncrypted() { - if ($this->encryptionSuccess === null) { + if ($this->encrypted === null) { return false; } - return $this->encryptionSuccess; + return $this->encrypted; } /**