Reputation: 5703
I created a simple web application from visual studio Web Application(Net.Core)
template with individual user account authorization.
Then, I enabled SSL in Project->MyProject Properties...
, copied URL with https to App Url.
Finally, I added:
services.AddMvc(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
to Startup
.
And it doesn't work! When I'm starting the application, it just simply turns off after a second, and nothing happens, no error, nothing!
What's wrong with SSL in Asp.Net Core, and how can I enable it correctly?
Upvotes: 8
Views: 41768
Reputation: 64121
For development testing you need to enable SSL first.
Right click the project > Properties > Debug
If your debugging stops after starting (no process ID found), then you have to install the IIS Express self-signed certificate into the certificate store.
You can follow this guide here. It's bit older but still applies to Visual Studio 2015. It's due to a bug in Update 3 where IIS Certificate isn't installed in the trusted certificate storage correctly.
Alternatively,
Now you should be able to debug it.
Upvotes: 20