0

I'm building an API in Visual Studio using ASP.NET Core Web Application, but since a couple of days ago it doesn't work anymore. When I run the API from Visual Studio using IIS Express I get an error in the browser: "ERR_CONNECTION_RESET".

The application does work when I disable SSL, but it should (and before did) work with SSL enabled.

Things I've tried:

  • Change port (within the correct range)
  • Delete localhost certificate and repair Visual Studio, prompting the creation of a new SSL certificate
  • Deleted the .VS file and restarted VS in administrator mode
  • Delete applicationhost.config and restarted VS in administrator mode
  • Created a fresh application with a working pre build WeatherAPI, but that has the same problem aswel
  • Ran SSL Diagnostics using Jexus and got the following
System Time: 18/06/2020 14:40:58

Processor Architecture: AMD64

OS: Microsoft Windows NT 10.0.18363.0

Server Type: IIS Express

SERVER SSL PROTOCOLS

PCT 1.0:

PCT 1.0 is not secure. OS default is used. You might explicitly disable it via registry.

SSL 2.0: 

SSL 2.0 is not secure. OS default is used. You might explicitly disable it via registry.

SSL 3.0: 

SSL 3.0 is not secure. OS default is used. You might explicitly disable it via registry.

TLS 1.0: 

TLS 1.0 is not secure. OS default is used. You might explicitly disable it via registry.

TLS 1.1: 

TLS 1.1 is not secure. OS default is used. You might explicitly disable it via registry.

TLS 1.2: 

SChannel EventLogging: 1 (hex)

To tune TLS related settings, please follow https://support.microsoft.com/en-us/kb/187498 or try out IIS Crypto from https://www.nartac.com/Products/IISCrypto/.

Microsoft documentation on cipher suites can be found at https://learn.microsoft.com/en-us/windows/desktop/secauthn/cipher-suites-in-schannel.

-----
[W3SVC/1]
ServerComment  : WebSite1
ServerAutoStart: True
ServerState    : Stopped

BINDING: http *:8080:localhost

For what it's worth I've also checked for the subkeys through Regedit, but couldn't find the subkeys inside HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\

I am completely at a loss what it could be

Edit: Tried it on another PC, on which it seems to work properly

5
  • You might try to run some diagnostics, docs.jexusmanager.com/tutorials/ssl-diagnostics.html Probably the certificate mapping in HTTP API has been removed. Commented Jun 18, 2020 at 11:49
  • Which browser and version are you using? Commented Jun 18, 2020 at 13:02
  • @LexLi thanks for your comment, I did this and added the information to the main question. To be honest, I didn't really know what the result meant exactly so I went to the websites it recommended and tried to locate the subkeys inside Protocols through regedit, but there weren't any. Commented Jun 18, 2020 at 13:03
  • @Nenad Thanks for your comment as well. I use Chrome as my standard browser (Version 83.0.4103.106) but the same kind of error occurs in FireFox, Edge and Opera. Commented Jun 18, 2020 at 13:05
  • As the report revealed, there is only a site with HTTP binding. No doubt HTTPS won't work at all. I doubt if you have configured the project in Visual Studio properly, as that should generate the HTTPS binding. Commented Jun 18, 2020 at 13:07

1 Answer 1

2

According to the binding configuration from the report, there is no https binding in your project.

BINDING: http *:8080:localhost

Please ensure you checked the option of configuring HTTPS binding while creating the AspDotNET CoreAPI project.
enter image description here
This will add additional code snippets to Startup.cs file.

//Adding middlewares for redirecting HTTP request to HTTPS
            app.UseHttpsRedirection();

And additional HTTPS binding configuration in launchSettings.json file.
enter image description here
Besides, most of the browsers start to support TLS1.2 only, please ensure that TLS1.2 is not disabled.
Feel free to let me know if the problem still exists.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for responding! My project has been set up exactly as you described, but I also created a new project following your steps, just for good measure. Problem sadly persists. I tried running the project on a different computer than mine, and there my project seems to work properly using HTTPS, so there is most likely a problem with my PC / VS I guess. (I will add it to the question aswell)
Do the other website in your PC work over https properly? Besides, when hosting the WebAPI project in IIS express, is there an https binding in launchSettings and a binding configuration in the IIS Express tray icon in the lower right corner?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.