1

I'm following along Microsoft's tutorial on Asp.net core web api (https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-5.0&tabs=visual-studio).

I'm trying to configure Kestrel and I've added this to appsettings.json

{
  "Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://localhost:5000"
      },
      "Https": {
        "Url": "https://localhost:5001"
      }
    }
  }
}

When I start the app now, https works fine, but the http connection does not work. I get "site can't be reached error".

Can someone explain why this is? If I remove the Kestrel configuration, both http and https work fine.

1 Answer 1

1

Looks like this was an issue with Chrome, not with Kestrel.

I had changed the port to 6000 and Chrome was not letting it go through as it had marked it as an unsafe port.

Postman and curl worked fine, so I was able to look through Chrome dev tools to troubleshoot.

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

Comments

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.