title: C# Web Request w RestSharp - "The request was aborted: Could not create SSL/TLS secure channel"
body: <p>I have an incredibly simple web request with RestSharp:</p>
  
  <pre><code>var client = new RestClient("https://website.net");
  var request = new RestRequest("/process", Method.GET);
  request.AddParameter("cmd", "execute");
  IRestResponse response = client.Execute(request);
  
  var content = response.Content;
  Console.WriteLine("Response: " + content);
  </code></pre>
  
  <p>This returns the error message:</p>
  
  <blockquote>
    <p>The request was aborted: Could not create SSL/TLS secure channel</p>
  </blockquote>
  
  <p>Three things:</p>
  
  <ol>
  <li>I get the response I expect through a browser,</li>
  <li>I get the response I expect through Postman,</li>
  <li>This request is being sent to a test environment, but I can send it to a production environment, which has a very similar address, and get the response I expect,</li>
  <li>I'm positive it worked before today.</li>
  </ol>
  
  <p>Their certificate is using TLS 1.2 with AES 128, so it is unrelated to errors caused by RC4.</p>
  
  <p>This is on my local Win 10 machine in Visual Studio 2015 with a target framework of .NET 4.5.2.</p>
  
  <p>Why do I get this error?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>By changing my code to use the base System.Net and the WebRequest class and adding the line:</p>
  
  <pre><code>ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  </code></pre>
  
  <p>as suggested from <a href="https://stackoverflow.com/questions/29213687/system-net-webexception-when-using-webclient-can-not-create-ssl-tls-secure-chan">here</a>, it works.  So I guess RestSharp is using the incorrect protocol for some reason?</p>