I have a moodle-installation that uses LDAPS auth which is very slow or does not work at all. It is debian 12, apache2.4, moodle4.1 and php7.4.
I had a test installation where things were just fine, I compared the configs and there is not much difference.
Here is what I found in my error logs but I have still no clue why it is that slow:
Bind result: ''\n Debug: \nError code: auth_ldap_noconnect_all\n* line 1997 of /auth/ldap/auth.php: moodle_exception thrown\n* line 1074 of /auth/ldap/auth.php: call to auth_plugin_ldap->ldap_connect()\n* line 1802 of /auth/ldap/auth.php: call to auth_plugin_ldap->is_role()\n* line 4513 of /lib/moodlelib.php: call to auth_plugin_ldap->sync_roles()\n* line 154 of /login/index.php: call to authenticate_user_login()\n'
AH01071: Got error 'PHP message: Default exception handler: Das LDAP-Modul kann keine Serververbindung herstellen: Server: 'ldaps://my-domain.de:10636', Bind result: ''\n Debug: \nError code: auth_ldap_noconnect_all\n* line 1997 of /auth/ldap/auth.php: moodle_exception thrown\n* line 1074 of /auth/ldap/auth.php: call to auth_plugin_ldap->ldap_connect()\n* line 1802 of /auth/ldap/auth.php: call to auth_plugin_ldap->is_role()\n* line 4513 of /lib/moodlelib.php: call to auth_plugin_ldap->sync_roles()\n* line 154 of /login/index.php: call to authenticate_user_login()\n', referer: https://www.my-domain.de/moodle/login/index.php
ldapsearch run on the server also works slow sometimes (times vary)
any hint that leads to finding a solution is appreciated.