Can't connect with ldaps

Hi, I set up nextcloud with ldap and it’s working well. Now I want to use ldaps ( port 636 ) instead of 389, I imported the certificate from ldap server, put it into the /etc/openldap/certs/ca.pem and put the line into the ldap.conf TLS_CACERT /etc/openldap/certs/ca.pem. Then I went into the web portal and change ldap to ldaps and port but the green button (configuration ok) changed into red (incorrect)

here’s my log from web :

Error: ldap_bind(): Unable to bind to server: Can’t contact LDAP server at /var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php#338

  1. <>OC\Log\ErrorHandler::onError()
  2. <>ldap_bind("*** sensiti … *")
  3. /var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php - line 338:call_user_func_array()
  4. /var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php - line 60:OCA\User_LDAP\LDAP->invokeLDAPMethod("*** sensiti … *")
  5. /var/www/html/nextcloud/apps/user_ldap/lib/Wizard.php - line 1093:OCA\User_LDAP\LDAP->bind("*** sensiti … *")
  6. /var/www/html/nextcloud/apps/user_ldap/lib/Wizard.php - line 696:OCA\User_LDAP\Wizard->connectAndBind()
  7. /var/www/html/nextcloud/apps/user_ldap/ajax/wizard.php - line 96:OCA\User_LDAP\Wizard->guessPortAndTLS()
  8. /var/www/html/nextcloud/lib/private/Route/Route.php - line 155:require_once("/var/www/ht … p")
  9. <>OC\Route\Route->OC\Route{closure}("*** sensiti … *")
  10. /var/www/html/nextcloud/lib/private/Route/Router.php - line 310:call_user_func()
  11. /var/www/html/nextcloud/lib/base.php - line 1006:OC\Route\Router->match()
  12. /var/www/html/nextcloud/index.php - line 36:OC::handleRequest()