Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing port in launchSettings.json gives "This site can’t be reached"

I created an empty asp.net core app using VS2017. Only thing I changed is the "sslPort": property in the launchSettings.json file. When I click run IIS Express chrome opens with url https://localhost:9995/ and gives the This site can't be reached The connection was reset. error

My launchSettings.json is the following

{
  "iisSettings": {
    "windowsAuthentication": false, 
    "anonymousAuthentication": true, 
    "iisExpress": {
      "applicationUrl": "http://localhost:39566",
      "sslPort": 9995
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "JccWeb2": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

What am I doing wrong?

like image 440
pantonis Avatar asked Dec 13 '22 12:12

pantonis


1 Answers

As stated in the docs, you use an incompatible port for ssl with IIS Express. Instead of "sslPort": 9995, replace with a port number between 44300 and 44399.

If you want to test SSL access to your site, you can do this with IIS Express by using an SSL port between 44300 and 44399 and using the IIS Express self-signed certificate. Trying to use SSL with a port outside this range results in a URL binding failure when your website is launched under IIS Express.

like image 187
spidyx Avatar answered Apr 03 '23 01:04

spidyx