title: System.Net.WebException in simple HTTPS Request
body: <p>I have got a problem with C# and a simple HTTPS-Request...</p>
  
  <p>I want to request this URL: <a href="https://api.sipgate.com/v1/" rel="nofollow noreferrer">https://api.sipgate.com/v1/</a> In a webbrowser it works fine, but my C#-Code doesn't work :( Has anybody an idea what I did wrong? Thank you!</p>
  
  <pre><code>using System.Net;
  using System.IO;
  
  // [...]
  
  WebRequest req = WebRequest.Create("https://api.sipgate.com/v1");
  req.ContentType = "application/json";
  
  try {
      WebResponse res = req.GetResponse();  // Exception here...
      Stream content = res.GetResponseStream();
      Console.WriteLine((new StreamReader(content)).ReadToEnd());
  } catch (Exception e) {
      Console.WriteLine(e.ToString());                
  }
  </code></pre>
  
  <p>Here is the exception:</p>
  
  <pre><code>System.Net.WebException: Die zugrunde liegende Verbindung wurde geschlossen: Unerwarteter Fehler beim Senden.. ---&gt; System.IO.IOException: Fehler bei Authentifizierung, da die Gegenseite den Transportstream geschlossen hat.
     bei System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
     bei System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
     bei System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
     bei System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
     bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     bei System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
     bei System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     bei System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
     bei System.Net.ConnectStream.WriteHeaders(Boolean async)
     --- Ende der internen Ausnahmestapelüberwachung ---
     bei System.Net.HttpWebRequest.GetResponse()
     bei Sipgate_Test.Program.Main(String[] args) in c:\users\abc\documents\visual studio 2017\Projects\def\hij\Program.cs:Zeile 24.
  </code></pre>
  
  <p>System.Net.WebException:</p>
  
  <blockquote>
    <p>Error in authentication because the other side has closed the transport stream.</p>
  </blockquote>