Groups > Novell > Novell ActiveX > LDAP w/SSL using Novell Active X - HELP!!




LDAP w/SSL using Novell Active X - HELP!!

LDAP w/SSL using Novell Active X - HELP!!
Mon, 12 Mar 2007 13:33:34 GMT
PLEASE HELP!

The class below works if i rem out all the stuff related to secure
connection, secure port, and the credentials it authenticates no problem.
But I keep getting a failed to connect to the LDAP server when I try to
make the connection secure. I have the credentials and the EDIRECTORY
server is setup for SSL.....

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: Failed to
connect to the LDAP server.

THANKS!
------------

Public Class NovellAuth
    Public Enum LoginResult
        Authenticated = 1
        InvalidLoginId = 2
        InvalidPassword = 3
        RuntimeError = 4
    End Enum
    Dim MyArray As String() = New String() {"null",
"Authenticated",
"Login Failed", "Password Failed",
"RunTimeError"}
     
    Public Function ValidateLogin(ByVal loginId As String, ByVal password
As String) As String
        Dim ldap As New NWIDirLib.NWIDirClass
        Dim entries As NWIDirLib.NWEntries
        Dim entry As NWIDirLib.NWEntry
        Dim result As LoginResult
        Dim strGroup As String
        Try
		'IT WORKS IF I REM OUT THE NEXT 3 LINES	
			ldap.SecureConnection = true
			ldap.Credentials = "SSL CertificateLDAP - NET-11-DS.der"
			ldap.SecurePort = 636



			ldap.SearchScope = NWIDirLib.NWSearchScope.dirSearchSubtree
			ldap.SearchMode = NWIDirLib.NWSearchMode.dirSearchSynchronous
            	
			
			'ldap.Credentials = "w:DepartmentshrrecruitmentNonInstvbSSL
CertificateLDAP - NET-11-DS.der"
			
            ldap.FullName = "ldap://192.168.1.11/o=ccps"
            ldap.LoginName =
"ldap://192.168.1.11/o=ccps/ou=NET/ou=USR/cn=ldapproxy"
            ldap.Password = "ldaplook"
            ldap.Connect()
            ldap.Filter = "cn=" & loginId

            entries = ldap.Search()
            If entries.Count = 0 Then
                result = LoginResult.InvalidLoginId
            Else
                entry = entries.Item(0)

                If entry.ValidatePassword(password) Then
                    result = LoginResult.Authenticated
                Else
                    result = LoginResult.InvalidPassword
                End If
            End If
            ldap.Disconnect()
        Catch ex As SQlException
            result = LoginResult.RuntimeError
        End Try
        Return MyArray(result)
    End Function
End Class

Post Reply
about | contact