Link to home
Start Free TrialLog in
Avatar of Emergent ESI
Emergent ESIFlag for United States of America

asked on

LDAD over SSL Error on a Server

Hello Everyone,

I was wondering if someone can help me solve this riddle.  I need to authenticate a user against LDAP over SSL.  I have written the following method:

//////////////////////////////////////
 public static bool UserAuthetication(string userName, string password, string domain)
 {
  bool authentic = false;
         
  try
  {
        DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain, userName, password,  AuthenticationTypes.SecureSocketsLayer | AuthenticationTypes.Secure);
                object nativeObject = entry.NativeObject;
                authentic = true;
  }
  catch (Exception e)
  {
        authentic = false;
        return authentic;
  }
        return authentic;
}

////////////////////////////////

The method is called from the code as follows:
   
UserAuthetication("myUser", "myPassW", "rootDSE");

So here is my problem.  The mehod works correctly from multiple Workstations.  However, this code runs on a server and the code errors out everytime I run it on the server.  The code is used t authenticate an incoming request on a server.  I am guessing it has to do with the SSL certificates on the server but I am not sure where to start looking or which certificate it could be.  

Any ideas?
Avatar of Stacy Spear
Stacy Spear
Flag of United States of America image

Whats the error?
Avatar of Emergent ESI

ASKER

darkstar3d:  Sorry for the delay.

On the Server I get:
The certificate received from the remote server does not contain the expected name.  It is therefore not possible to determine whether we are connecting to the correct server.  The server name we are expecting is [Domain.corp.com].  The SSL connection request has failed.

On the program the exception that is thrown is:
Logon failure:unknown user name or babd password,

The weird part is that this program works fine on the workstations but not on the servers.  ????

ASKER CERTIFIED SOLUTION
Avatar of Emergent ESI
Emergent ESI
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial