title: Client certificate with HttpClient in c#
body: <p>Want to send data with client certificate (.p12 or .pfx) from Windows application to Server machine,  Windows application developed in .Net Framework 4.6, OS is windows 10.</p>
  
  <p>When hit from postman with client certificate (.p12 or .pfx) [Loaded in setting tab -> Add client certificate - > put hostname, select pfx file, put password], all working properly  (client certificate send to server machine), but issue from below c# code,</p>
  
  <pre><code>X509Certificate2 certificate = new X509Certificate2(certificateFilePath, "password");
  WebRequestHandler handler = new WebRequestHandler();
  handler.ClientCertificateOptions = ClientCertificateOption.Manual;
  handler.ServerCertificateValidationCallback = (a, b, c, d) =&gt; { return true; };
  handler.ClientCertificates.Add(certificate);
  
  
  HttpClient request = new HttpClient(handler);
  request.DefaultRequestHeaders.Add("User-Agent", UserAgent);
  // added other headers and data
  var result = request.PostAsync(url, byteContent).Result;
  string resultContent = result.Content.ReadAsStringAsync().Result;
  </code></pre>
  
  <p>Also cross check with fiddler for Postman hit and c# hit. </p>
  
  <p>When server not receive client certificate, it return 403 error.</p>