LDAP port 636 DirectorySearch.FindOne fails - The server is not operational

1

Running the following code with port 636 (secure) through a console application it works fine, however through a ASP.Net web site it fails:

            DirectoryEntry authServer = new DirectoryEntry(@"LDAP://zxxx.cf.ac.uk:636", "", "", AuthenticationTypes.Anonymous);
            DirectorySearcher directorySearch = new DirectorySearcher(authServer, "(CN=sissh6)");
            SearchResult result = directorySearch.FindOne();

Here is the error:

 Problem authenticating : System.Runtime.InteropServices.COMException (0x8007203A):
 The server is not operational.

  at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
  at System.DirectoryServices.DirectoryEntry.Bind()
  at System.DirectoryServices.DirectoryEntry.get_AdsObject()
  at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
  at System.DirectoryServices.DirectorySearcher.FindOne()

Now if we use non secure (no port 636) then the problem disappears, but the final solution must be secure.

Why would the secure version work through a console application but not through asp.net?

ldap
directoryservices
asked on Stack Overflow Oct 22, 2012 by user30803 • edited Oct 23, 2012 by user30803

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0