It is ok to to connect to LDAP with port 385 by the following:
public bool ConnectLDAP() {
string userDN = "urDN"; // Change to match your Distinguished Name (DN)
LdapConnection ldapConn = new LdapConnection();
ldapConn.Connect("urServerAddr", 389); // 389 is the default port.
if (ldapConn.Connected) {
try
{
ldapConn.Bind (ldapVersion,userDN,Password.Value);
return true; 
}
catch(LdapException ldapErr)
{
Response.Write(ldapErr.LdapErrorMessage);
return false;
}
}
}

However, when I try to connect it with SSL, I got error msg:
Novell.Directory.Ldap.LdapException: SSL Priovider not found
public bool ConnectLDAP() {
string userDN = "urDN";
int ldapVersion = LdapConnection.Ldap_V3;
LdapConnection ldapConn = new LdapConnection();
ldapConn.SecureSocketLayer = true;
ldapConn.Connect("urLDAPAddress", 636); // SSL
bool t;
if (ldapConn.Connected) {
try
{
ldapConn.Bind (ldapVersion,userDN,Password.Value);
return true;
}
catch(LdapException ldapErr)
{
Response.Write(ldapErr.LdapErrorMessage);
return false;
}
}
else
{
Response.Write("Not Connected!");
return false;
}
}
I have searched most of the google.. found nothing but ssl connection only available with mono...
http://forge.novell.com/modules/xfmod/newsportal/article.php?group_id=1318&msg_id=575&group=novell.devsup.ldapcsharp
anyone try with msft?


浙公网安备 33010602011771号