[Solved] ERR_CONNECTION_RESET with SSL and ASP.NET

I was in the process of migrating an application from forms authentication to Azure identity authentication. Initially, everything seemed straightforward, especially since I had another application already functioning with the new authentication method. However, my optimism quickly waned when I encountered unexpected issues during testing.

Upon inspecting the setup, I found that despite setting everything up correctly and migrating the code, the authentication process wasn’t successful. The initial hiccup was with the nonce, where it was set to true but appeared null during testing. Oddly, although I could observe a nonce in the post to the authenticate endpoint, the external authentication callback URL breakpoint wasn’t triggering at all.

After scouring through Stack Overflow for solutions, I stumbled upon a crucial clue buried within a post:

https://stackoverflow.com/a/63556294/5906543

A noteworthy observation emerged: the working site was configured with HTTPS, while the problematic site relied on HTTP, despite both running on localhost. Could it really be that simple?

To rectify this issue, I followed these two primary steps to revert the site back to HTTPS:

  1. Adjust the project settings in Visual Studio to utilize HTTPS. (Instructions on how to do this can be found in the project settings.)
  2. Implement a self-signed certificate for localhost:port. This involves opening Command Prompt with administrative privileges, navigating to “C:\Program Files (x86)\IIS Express,” and executing the command:
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:PORT/ -UseSelfSigned

Replace “PORT” with the specific port you’re utilizing.

By addressing these steps, hopefully, you can resolve any ERR_CONNECTION_RESET issues related to SSL and proceed with your coding tasks smoothly.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *