Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't connect to a TLS web service using C# and digest authentication, Firefox succeeds where IE8 fails
    primarykey
    data
    text
    <p>I'm trying to connect to a web service using C# and digest authentication, but every time I got the <code>401 - Not Authorized</code> error. But when I try to reach the service over Firefox, everything's OK. When I use IE8, my password is not accepted and I got a 401. </p> <p>Do you have any ideas? Thanks for the help.</p> <p>Here's the test code I'm using:</p> <pre><code> ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; Uri uri = new Uri(URL); NetworkCredential netCredential = new NetworkCredential(username, password); CredentialCache cache = new CredentialCache(); cache.Add(URL, 443, "Digest", netCredential); WebRequest request = WebRequest.Create(URL); request.Credentials = cache; request.PreAuthenticate = true; request.Method = "POST"; WebResponse response; try { response = request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream); string result = reader.ReadToEnd(); Response.Write(result); response.Close(); reader.Close(); } catch (Exception ex) { Response.Write("Error: " + ex.Message + "&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;"); Response.Write("Request Headers&lt;br/&gt;&lt;br/&gt;"); WebHeaderCollection headers = request.Headers; // Get each header and display each value. foreach (string key in headers.AllKeys) { string value = headers[key]; Response.Write(key + ": " + value); Response.Write("&lt;br/&gt;&lt;br/&gt;"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload