We help IT Professionals succeed at work.
Get Started

LDAD over SSL Error on a Server

Kozela
Kozela asked
on
464 Views
Last Modified: 2013-12-24
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?
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE