title: How to use HTTPS / SSL with Kestrel in ASP.NET Core 2.x?
body: <p>I am currently using ASP.NET Core 2.x and I used to be able to get Kestrel to to use HTTPS / SSL by simply putting it in the <code>UseUrls()</code> method like so:</p>
  
  <pre><code>var host = new WebHostBuilder()
      .UseUrls("http://localhost", "https://111.111.111.111")
      .UseKestrel()
      .Build();
  </code></pre>
  
  <p>But now I get the exception: </p>
  
  <pre><code> System.InvalidOperationException:
       HTTPS endpoints can only be configured using KestrelServerOptions.Listen().
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p><strong>How do I configure Kestrel to use SSL in ASP.NET Core 2.x?</strong></p>
  </blockquote>