Emergent ESI
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.Secure SocketsLay er | 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?
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.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"
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?
Whats the error?
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. ????
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.