Hi,

I am using ApacheDS 1.0-RC3, running as a Windows service with default supplied configuration (service.xml). Using JXplorer, I added an X.509 certificate and I am able to view that certificate using JXplorer again. However, when I want to search for the entries containing this certificate, my searches fail.

Here are the code snippets that fail:

        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        X509Certificate cert = (X509Certificate) cf.generateCertificate(new FileInputStream(" test-cert.der"));
        SearchControls constraints = new SearchControls();
        constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
        NamingEnumeration results = ctx.search("ou=users,o=myorg,dc=example,dc=com", "userCertificate;binary= {0}", new Object[] {cert}, constraints);
        // results are empty but one entry is expected

If I omit ';binary' in attribute name, I get exception:

        CertificateFactory cf = CertificateFactory.getInstance("X.509");
        X509Certificate cert = (X509Certificate) cf.generateCertificate(new FileInputStream("test-cert.der"));
        SearchControls constraints = new SearchControls();
        constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
        NamingEnumeration results = ctx.search("ou=users,o=myorg,dc=example,dc=com", "userCertificate= {0}", new Object[] {cert}, constraints);
        // the last line thows exception:
javax.naming.NamingException: [LDAP: error code 54 - failed on search operation]; remaining name 'ou=users,o=ActiveMQ,dc=example,dc=com'


Please advise me of the proper way to resolve this problem.

Regards,
NGC