title: How to implement TLS 1.2 in ASP.Net Core 2.0
body: <p>Platform Details: C#, .Net Core 2.0, WS 2016, IIS &amp; Kestrel in reverse proxy</p>
  
  <p>My web app must use HTTPS and TLS 1.2. It was running fine with SSL already, but that is inadequate. I found details online about registry edits needed for TLS 1.2 as default on my web server, and made those changes. After these registry edits, my original code still worked. To force the use of TLS1.2 I added the following to my UseKestrel() in the buildwebhost method.</p>
  
  <pre><code>options =&gt;
  {
      options.Listen(System.Net.IPAddress.Loopback, 443, listenOptions =&gt;
      {
          listenOptions.UseHttps(new HttpsConnectionAdapterOptions { SslProtocols = SslProtocols.Tls12 });
      }
  }))
  </code></pre>
  
  <p>Now the site is throwing a 502.5. IIS is configured with the original certificate and the site is bound to port 443. I've been told the cert itself is the same between SSL and TLS, so I don't need to get another. When I attempt to debug the code with local host my VS returns an error saying</p>
  
  <blockquote>
    <p>System.ArgumentException: 'The server certificate parameter is required.'</p>
  </blockquote>
  
  <p>I have found detail of an "X509Certificate2" object, and some different implementations where the author is using a load method to stream that certificate from a location on the server, but I don't know if that's what's needed here. </p>