title: TLS 1.2 - Alert Level - Fatal - Description Protocol Version
body: <p>I am trying to connect to a web service which uses 2-way authentication on TLS version 1.2. The SSL handshake fails and I get the following handshake error when I sniff the packets on wireshark. (My client terminates the handshake by sending &quot;RST, ACK&quot;):</p>
  <p><a href="https://i.stack.imgur.com/NFD9y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NFD9y.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/GxXsD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GxXsD.png" alt="enter image description here" /></a></p>
  <p>Also I get the following SCHANNEL error log on the windows event viewer:</p>
  <blockquote>
  <p>A fatal alert was generated and sent to the remote endpoint. This may
  result in termination of the connection. The TLS protocol defined
  fatal alert code is 10.</p>
  <p>Target name: </p>
  <p>The TLS alert registry can be found at
  <a href="http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-6" rel="nofollow noreferrer">http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-6</a></p>
  </blockquote>
  <p>What does it mean? and what can I do about it? Here is my c# code:</p>
  <pre><code>var cert = new X509Certificate2(PfxBytes);
  
  using (var handler = new HttpClientHandler())
  {
      handler.ClientCertificateOptions = ClientCertificateOption.Manual;
      handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =&gt; true;
      handler.ClientCertificates.Add(cert);
      handler.SslProtocols = SslProtocols.Tls12;
  
      using (var client = new HttpClient(handler, false))
      {
      var postData = new StringContent(&quot;&quot;, UnicodeEncoding.UTF8, &quot;application/json&quot;);
      var response = await client.PostAsync(&quot;&lt;URL&gt;&quot;, postData);
  
      string responseString = await response.Content.ReadAsStringAsync();
      Console.WriteLine(responseString);
      }
  }
  </code></pre>
  <p>The surprising thing is this works fine on postman with the same certificate. So I am pretty sure nothing is wrong with the certificate. Unable to figure out what is going wrong with my c# code.</p>
  <p>Please Help.</p>