14

So, this is my first time diving into ASP.NET. I've programmed in C# before (Unity), but I've never made a ASP.NET app. The problem is, I can't seem to get SSL to work! When I create a new project using these steps, I get the following error:

ERR_CONNECTION_RESET

However, it works perfectly fine when I go to Properties > Debug and uncheck "Enable SSL". I've also tried using Microsoft Edge, but it gives the same error. Here is what I have tried to fix this:

  1. Disable my antivirus software (Kaspersky) and restart Chrome
  2. Restart my computer
  3. Delete the applicationhost.config file in the .vs folder (source)
  4. Delete the .vs folder and run a command (more info here)
  5. Run VS Studio as Administrator
  6. Delete a domain security policy in Chrome (more info here)
  7. Do netsh http show iplisten - nothing was listed (source)
  8. Repair IIS (Control Panel > Programs & Features > Select IIS > Repair)
  9. Check if the port # was in the correct range (source)
  10. Make sure there is only one certificate for localhost (source)
  11. Follow the steps here
  12. Uninstall and re-install IIS
  13. LITERALLY UNINSTALL AND REINSTALL ASP.NET
  14. Run in incognito mode (Chrome)

As you can see, I've tried everything that has come to my mind. Could somebody please explain why this is happening? To re-iterate, this happens when I don't change any of the default code you get by following these steps, so it can't be a timeout or something.

I'm using IIS Express 10.0 (iisexpress_amd64_en-US.msi from here) with .NET Core 5.0 and Visual Studio 19. As of now, everything is up to date.

I really, really hope you guys can help me with this!!! I would want to use https (because, ofc, its more secure than http).

EDIT: I have tried using Firefox, and who would've guessed? It's the same error. (PR_CONNECT_RESET_ERROR)

Ayush Garg
  • 2,234
  • 2
  • 12
  • 28
  • Are you using IIS 10? Or are you using IIS Express? – mason Feb 26 '21 at 15:48
  • @mason Whoops, sorry. I meant I'm using IIS Express 10. Let me make that more clear in my question. Basically, after uninstalling, I used `iisexpress_amd64_en-US.msi` from https://www.microsoft.com/en-us/download/details.aspx?id=48264 (which is IIS Express 10.0 as of right now). – Ayush Garg Feb 26 '21 at 15:50
  • Recently, SSL stopped working for many of my local development projects in IIS Express. I discovered that this seems to be a Google Chrome issue. [This one](https://superuser.com/a/881431/11720) helped me in my specific case. – Uwe Keim Feb 26 '21 at 16:00
  • @UweKeim However, I have tried doing this in Microsoft Edge, and it doesn't seem to be working there (as stated in my question). Anyway, I don't care about a http -> https change; https is just not working. – Ayush Garg Feb 26 '21 at 16:04
  • did you try in Incognito tab (Browse in private) ?. in Windows, Linux, or Chrome OS: Press Ctrl + Shift + n and this will open a new Incognito tab – NAS Feb 26 '21 at 20:18
  • @NAS Same error in incognito. – Ayush Garg Feb 26 '21 at 20:48

1 Answers1

42

I ran into the same issue on a fresh Windows 10 and VS2019 install, for me this solved it

https://improveandrepeat.com/2020/05/recreate-the-self-signed-https-certificate-for-localhost-in-iis-express/

In short

  1. Open cmd with admin rights
  2. Navigate to “C:\Program Files (x86)\IIS Express”
  3. Run IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:PORT/ -UseSelfSigned changing PORT for the port you're trying to use.
Robert
  • 642
  • 7
  • 11