If ldapsearch returns an LDAP error rather than the RootDSE object, you may need to authenticate before reading the RootDSE. A possible correction is to create a service user for the database and repeat the test using -D and -w options to pass the user's identity and password respectively to the directory.