title: SSL TLS communication in c# with self signed certificate not working
body: <p>I have a .pem certificate file which is used to communicate between two servers. For communication I have written a program in C# like this:</p>
  
  <pre><code>var client = new RestClient("https://aaaaa.com:1111");
  client.ClientCertificates = new X509CertificateCollection();
  client.ClientCertificates.Add(new X509Certificate(@"C:\Users\aaa\Desktop\bbb.pem"));
  
  var request = new RestRequest("/qqq/www", Method.POST);
  request.AddJsonBody(new { create = new { msgBdy="Test" } });
  var response = client.Execute(request);
  
  Console.WriteLine(response.StatusCode);
  //The underlying connection was closed: An unexpected error occurred on a send.
  </code></pre>
  
  <p>When I post the request through SoapUI it goes through, but when I try to send it through Postman or the above C# program it doesn't.</p>
  
  <p><a href="https://i.stack.imgur.com/XInZp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XInZp.png" alt="enter image description here"></a>
  Screenshot from wireshark is below:
  <a href="https://i.stack.imgur.com/Q1Jxr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q1Jxr.png" alt="enter image description here"></a></p>
  
  <p>The change cipher spec event is called for the successful API call but through postman and c# application this event is never called.</p>
  
  <p>I have tried to do this as explained in this article as well <a href="https://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication" rel="nofollow noreferrer">https://www.codeproject.com/Articles/326574/An-Introduction-to-Mutual-SSL-Authentication</a> but that also didn't work.</p>
  
  <p>How can I fix this issue.</p>