PHP warning

ldap_start_tls(): Unable to start TLS: Protocol error

/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359)

347         }
348 
349         $connectionSuccessful = ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldapver);
350         if (!$connectionSuccessful) {
351             return array("errorCode" => 1, "errorMessage" => gT('Error creating LDAP connection'));
352         }
353         ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, $ldapoptreferrals);
354 
355         // Apply TLS only if ldaps is not used - you can use either SSL or TLS - both does not work
356         // TLS also requires LDAPv3
357         if (!empty($ldaptls) && $ldaptls == '1' && $ldapver == 3 && preg_match("/^ldaps:\/\//", $ldapserver) === 0) {
358             // starting TLS secure layer
359             if (!ldap_start_tls($ldapconn)) {
360                 ldap_unbind($ldapconn); // Could not properly connect, unbind everything.
361                 return array("errorCode" => 100, 'errorMessage' => ldap_error($ldapconn));
362             }
363         }
364 
365         return $ldapconn;
366     }
367 
368     public function beforeLogin()
369     {
370         if ($this->get('is_default', null, null, false) == true) {
371             // This is configured to be the default login method

Stack Trace

#0
+
 /home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359): ldap_start_tls(resource)
354 
355         // Apply TLS only if ldaps is not used - you can use either SSL or TLS - both does not work
356         // TLS also requires LDAPv3
357         if (!empty($ldaptls) && $ldaptls == '1' && $ldapver == 3 && preg_match("/^ldaps:\/\//", $ldapserver) === 0) {
358             // starting TLS secure layer
359             if (!ldap_start_tls($ldapconn)) {
360                 ldap_unbind($ldapconn); // Could not properly connect, unbind everything.
361                 return array("errorCode" => 100, 'errorMessage' => ldap_error($ldapconn));
362             }
363         }
364 
#1
+
 /home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(482): AuthLDAP->createConnection()
477         $bindpwd = $this->get('bindpwd');
478         $groupsearchbase        = $this->get('groupsearchbase');
479         $groupsearchfilter      = $this->get('groupsearchfilter');
480 
481         // Try to connect
482         $ldapconn = $this->createConnection();
483         if ($ldapconn === false) {
484             $this->setAuthFailure($ldapconn['errorCode'], gT($ldapconn['errorMessage']));
485             return;
486         }
487 
#3
+
 /home/limesurvey.shnoulle.net/www/application/libraries/PluginManager/PluginManager.php(269): call_user_func(array(AuthLDAP, "newUserSession"))
264                 if (
265                     !$event->isStopped()
266                     && (empty($target) || in_array(get_class($subscription[0]), $target))
267                 ) {
268                     $subscription[0]->setEvent($event);
269                     call_user_func($subscription);
270                 }
271             }
272         }
273 
274         return $event;
2022-10-14 12:08:30 nginx/1.18.0 Yii Framework/1.1.26
Application Log
Timestamp Level Category Message
12:08:30.221682 error php
ldap_start_tls(): Unable to start TLS: Protocol error
(/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php:359)
Stack trace:
#0
/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(359):
ldap_start_tls()
#1
/home/limesurvey.shnoulle.net/www/application/core/plugins/AuthLDAP/AuthLDAP.php(482):
AuthLDAP->createConnection()
#2 unknown(0): AuthLDAP->newUserSession()
#3
/home/limesurvey.shnoulle.net/www/application/libraries/PluginManager/PluginManager.php(269):
call_user_func()
#4
/home/limesurvey.shnoulle.net/www/application/core/LSUserIdentity.php(73):
LimeSurvey\PluginManager\PluginManager->dispatchEvent()
#5
/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(163):
LSUserIdentity->authenticate()
#6
/home/limesurvey.shnoulle.net/www/application/controllers/admin/Authentication.php(47):
prepareLogin()
#7 unknown(0): Authentication->index()
#8
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/actions/CAction.php(115):
ReflectionMethod->invokeArgs()
#9
/home/limesurvey.shnoulle.net/www/application/core/SurveyCommonAction.php(83):
Authentication->runWithParamsInternal()
#10
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(308):
Authentication->runWithParams()
#11
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(286):
AdminController->runAction()
#12
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CController.php(265):
AdminController->runActionWithFilters()
#13
/home/limesurvey.shnoulle.net/www/application/controllers/AdminController.php(202):
AdminController->run()
#14
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(282):
AdminController->run()
#15
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/web/CWebApplication.php(141):
LSYii_Application->runController()
#16
/home/limesurvey.shnoulle.net/www/third_party/yiisoft/yii/framework/base/CApplication.php(185):
LSYii_Application->processRequest()
#17 /home/limesurvey.shnoulle.net/www/index.php(192):
LSYii_Application->run()
REQUEST_URI=/index.php?r=admin/authentication/sa/login