Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help
in Search

Problem with StartTransportLayerSecurity(null) method

Last post 08-21-2008, 5:58 AM by enne87. 4 replies.
Sort Posts: Previous Next
  •  08-20-2008, 2:18 AM 4461

    Problem with StartTransportLayerSecurity(null) method

    Hi!

    I have the following C# - code:

    string hostOrDomainName = "c8600385.m286:389";
    string userName = "cn=readadmin,o=arz";
    string password = "diaschauambergundaufderwiese";

    LdapConnection connection = new LdapConnection(hostOrDomainName);
               
    NetworkCredential credential =
      new NetworkCredential(userName, password);

    connection.Credential = credential;
     connection.AuthType = AuthType.Basic;

    LdapSessionOptions options = connection.SessionOptions;
    options.ProtocolVersion = 3;


     try
    {
         options.StartTransportLayerSecurity(null);
          Console.WriteLine("TLS started.\n");
     }
      catch (TlsOperationException e)
      {
       }

    Everything works fine until I reach the StartTransportLayerSecurity() - method. I always get a TlsOperationException with the errorMessage "InvalidAuthentication", but my authentication informations are ok.

    Can anyone of you help me pls?

    Best regards,

    enne
  •  08-20-2008, 11:04 AM 4462 in reply to 4461

    Re: Problem with StartTransportLayerSecurity(null) method

    Are you sure SSL works in general?  Did you try setting SecureSocketLayer on your session options to verify that works ok?  I'm guessing the problem is related to certificates and not credentials.
  •  08-20-2008, 11:15 AM 4463 in reply to 4462

    Re: Problem with StartTransportLayerSecurity(null) method

    Yep, I connected over port 636 with SessionOptions.SecureSocketLayer = true and this works fine.
    Maybe certificates are the problem, but I have no idea what I should do with my certs to get this method working.
  •  08-20-2008, 12:30 PM 4464 in reply to 4463

    Re: Problem with StartTransportLayerSecurity(null) method

    I don't really have any idea then, sorry.  You might check on the server for any useful logs.  You might also consider trying to do the same thing using ldp.exe and its StartTLS menu option to see if you can get it to work that way or get some additional error details.

    Otherwise you might be stuck putting in a ticket to Microsoft on this one.

  •  08-21-2008, 5:58 AM 4474 in reply to 4464

    Re: Problem with StartTransportLayerSecurity(null) method

    Ok, thanks much for your help joe, if I can solve this problem I'll write a post in this thread.

    Thanks and best regards.
View as RSS news feed in XML