简体   繁体   中英

ERR_CONNECTION_RESET with SSL and ASP.NET

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM