Another Failure on HttpWebrequest with inner exception Authentication failed because the remote party has closed the transport stream
<p>I know this has been asked before but the solutions suggested in those cases have not work for me. I have a simple console app that scrapes data from a website. Last night they updated their security settings so my code doesn't work anymore. </p>

<p>Here Is the code snippet I'm trying to use:</p>

<pre><code>try
{
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
    var request2 = WebRequest.Create("https://www.eex-transparency.com/") as HttpWebRequest;
    request2.Method = "GET";
    request2.Accept = "text/html, application/xhtml+xml, */*";
    request2.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-gb");
    request2.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
    request2.Headers.Add("DNT", "1");
    request2.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko";
    request2.Host = "www.eex-transparency.com";
    request2.KeepAlive = true;
    request2.Headers.Set(HttpRequestHeader.CacheControl, "no-cache");
    request2.Proxy = ProxyFactory.GetWebProxy();
    using (var response = request2.GetResponse())
    {}
}
catch (Exception ex)
{ Console.WriteLine(ex);}
</code></pre>

<p>There error I receive is:</p>

<blockquote>
  <p>System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed becausethe remote party has closed the transport stream.</p>
  
  <p>at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)</p>
  
  <p>at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocol
  Request asyncRequest)</p>
  
  <p>at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, A
  syncProtocolRequest asyncRequest)</p>
  
  <p>at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)</p>
  
  <p>at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)</p>
  
  <p>at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)</p>
  
  <p>at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)</p>
  
  <p>at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)</p>
  
  <p>at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)</p>
  
  <p>at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)</p>
  
  <p>at System.Net.ConnectStream.WriteHeaders(Boolean async)</p>
  
  <p>--- End of inner exception stack trace ---</p>
</blockquote>

<p>Any help will be greatly appreciated.</p>

<p>Thanks in advance.</p>