aspnet core error: Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.RequireHttpsAttribute'
<p>I am building and testing a aspnet core app using SSL. Running the site in IIS Express works fine. So, I thought I might see what's required to get it running on IIS 10. As expected, there are a few issues.</p>

<p>First off, I need to clarify that I have successfully hosted a non SSL aspnet app in IIS, so all the bits needed for an aspnet core app are there. But in the case of a SSL app, all I get is a message in the browser saying that an error occurred. Also nothing useful in the webserver logs.</p>

<p>So, my first test was to try and run the app directly in the published folder using dotnet xxx.dll. That's when I noticed the authorization error.</p>

<pre><code> services.Configure&lt;MvcOptions&gt;(options =&gt;
  {
    options.Filters.Add(new RequireHttpsAttribute());
  });
</code></pre>

<p><a href="https://i.stack.imgur.com/XaUAD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XaUAD.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/b1Zr2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b1Zr2.png" alt="enter image description here"></a></p>