I'm trying to configure my AspNetCore application to use TLS. However, when I run the application, I get the following error:
Secure Connection Failed
An error occurred during a connection to localhost:54321. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG
So far, I have selected "Enable SSL" in the project properties. I've also added:
public void ConfigureServices(IServiceCollection services)
{
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
And:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
RewriteOptions options = new RewriteOptions()
.AddRedirectToHttps();
app.UseRewriter(options);
I'm hosting this under IIS Express. My guess is that this is caused because I haven't specified a certificate; but all the articles I can find on this assume use of Kestrel.
Any help would be appreciated.