title: SslStream.AuthenticateAsClient is not working
body: <p>I'm trying to connect to an https server using the SslStream class (the server uses a trusted root certificate), but when i use the SslStream.AuthenticateAsClient(String, X509CertificateCollection, SslProtocols, Boolean), the program stands there infinitely without throwing any exception or going on.
  Here is the code:</p>
  
  <pre><code>String serverName = "https://192.168.32.74/params.cgi";
  String pfxName = @"C:\...\server.pfx";
  
  X509Certificate2 certificate = new X509Certificate2(pfxName, "mypassword");
  //Create new X509 store called teststore from the local certificate store.
  X509Store store = new X509Store("teststore", StoreLocation.CurrentUser);
  
  //Create a collection and add two of the certificates.
  X509Certificate2Collection collection = new X509Certificate2Collection();
  collection.Add(certificate);
  
  store.Open(OpenFlags.ReadWrite);
  store.AddRange(collection);
  try
  {
      TcpClient client = new TcpClient();
          client.Connect(server, port);
          SslStream sslStream = new SslStream(
              client.GetStream(),
              false,
              new RemoteCertificateValidationCallback(ValidateServerCertificate),
              null);
  
          sslStream.AuthenticateAsClient(
              serverName,
              collection,
              SslProtocols.Default,
              true);
  }
  catch (Exception ex)
  {
      Console.WriteLine("Exception: {0}", ex.ToString());
  }
  ...
  </code></pre>
  
  <p>Does anyone know why i am having this issue?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I have updated the code with the .pfx file</p>