title: How to RestSharp add client certificate in Https request? (C#)
body: <p>How to RestSharp add client certificate in Https request ? My code it doesn't work .</p>
  
  <pre><code>    public static IRestResponse&lt;User&gt; AsyncHttpRequestLogIn(string path, string method, object obj)
      {
          var client = new RestClient(Constants.BASE_URL + path); // https:....
          var request = method.Equals("POST") ? new RestRequest(Method.POST) : new RestRequest(Method.GET);
          request.RequestFormat = RestSharp.DataFormat.Json;
  
          // The path to the certificate.
          string certificate = "cer/cert.cer";     
  
          client.ClientCertificates.Add(new X509Certificate(certificate));
  
          request.AddBody(
              obj
          );
  
  
          IRestResponse&lt;User&gt; response = client.Execute&lt;User&gt;(request);
  
          return response;
  
      }
  </code></pre>