Search code examples
c#.nethttpsasp.net-core-webapiwebapi

Web API project is not working locally when using port 443 for HTTPS endpoint


I have a Web api project with target framework .net 6.0. I'm using Kestrel server to run the project locally using visual studio 2022. App runs smoothly when I use any port number other than 443 for the HTTPS url. If I use 443 for the HTTPS, app is not running(swagger page is not loading). Any hint why HTTPS url is not working with 443?

  "Kestrel": {
    "EndPoints": {
      "Https": {
        "Url": "https://localhost:443"
      },
      "Http": {
        "Url": "http://localhost:8080"
      }
    }
  }

Solution

  • As @Alexei Levenkov pointed out correctly, There is a system process with PID 4 was already using the port 443. I was able to run the service successfully when using a different port other than 443.