Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I specify my SSL port for IISExpress?

OK, so I used to be able to change the SSL port number in the project properties dialog, but after the asp.net 5 RC1 update, the SSL field is read-only:

enter image description here

It ignores the SSLPort value when I attempt to edit the .xproj directly:

<PropertyGroup>
    <SchemaVersion>2.0</SchemaVersion>
    <DevelopmentServerPort>17204</DevelopmentServerPort>
    <SSLPort>44303</SSLPort>
  </PropertyGroup>

And it also resets the port in my app host config file ($[solutionDir].vs\config\applicationhost.config) back to the original value when I change the binding and launch my project.

        <site name="WebApplication1" id="8">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="C:\WebApplication1\wwwroot" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:17833:localhost" />
                <binding protocol="https" bindingInformation="*:44303:localhost" />
            </bindings>
        </site>

What gives? Where is Visual Studio getting this value from, and how do I change it?

like image 816
Jarem Avatar asked Nov 18 '15 21:11

Jarem


People also ask

What port is IIS Express using?

By default IIS Express uses port 8080, but you can use any HTTP port you like. You can also run these from the WIndows Command line in the Web Connection install folder by running Console.exe .

How do I change the port for IIS Express?

In Solution Explorer, right-click the name of the web application and select Properties. Click the Web tab. In the Servers section, under dropdown selection for IIS Express, change the port number in the Project URL box. To the right of the Project URL box, click Create Virtual Directory, and then click OK.

How do I run IIS Express with https?

To enable the SSL with in IIS Express, you have to just set “SSL Enabled = true” in the project properties window. With this; you can access any of the URL from your browser and run the application. Hope this helps.

How do I enable https in Visual Studio?

Copy that URL and go to the project properties window. Locate the Web tab and override the Project URL property with the https address: After that, you need to setup a trusted certificate for Visual Studio.


1 Answers

Open launchSettings.json under the ./Properties folder. The int value in iisSettings > iisExpress > sslPort is where it's read from. You can change that value to whatever you want.

{
  "iisSettings": {
    "iisExpress": {
      "sslPort": <ssl-port-value>
    }
  }
}
like image 128
Dealdiane Avatar answered Sep 19 '22 05:09

Dealdiane