LDAP Authentication using Port 636

We have trid to configure nextcloud to use LDAP authentication by using port 636. But got an error “Lost connection to LDAP server. The Base DN appears to be wrong”. The same configuration is working fine for other applications.