【问题标题】:Where do I specify my SSL port for IISExpress?我在哪里为 IISExpress 指定我的 SSL 端口?
【发布时间】:2015-11-23 20:57:08
【问题描述】:

好的,所以我以前可以在项目属性对话框中更改 SSL 端口号,但是在 asp.net 5 RC1 更新后,SSL 字段是只读的:

当我尝试直接编辑 .xproj 时,它会忽略 SSLPort 值:

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

当我更改绑定并启动我的项目时,它还会将我的应用程序主机配置文件 ($[solutionDir].vs\config\applicationhost.config) 中的端口重置为原始值。

        <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>

什么给了? Visual Studio 是从哪里获得这个值的,我该如何改变它?

【问题讨论】:

    标签: asp.net ssl asp.net-core


    【解决方案1】:

    ./Properties 文件夹下打开launchSettings.json。 iisSettings > iisExpress > sslPort 中的 int 值是读取它的位置。您可以将该值更改为您想要的任何值。

    {
      "iisSettings": {
        "iisExpress": {
          "sslPort": <ssl-port-value>
        }
      }
    }
    

    【讨论】:

    • IISExpress 必须在 44300-44399 范围内才能真正启用 SSL。如果您输入 6000 之类的内容,则它将不起作用,您将得到一个空白页。显然,您可以使用以管理员身份运行的任何端口。 docs.microsoft.com/en-us/iis/extensions/using-iis-express/…
    • @Simon_Weaver 但./Properties 文件夹及其launchSettings.json 在哪里?这是否仅适用于 .net 核心且特定于 .net 核心?
    • @DonCheadle 是的。对于传统来说,它是不同的。应该很容易查找。
    猜你喜欢
    • 1970-01-01
    • 2015-12-26
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 2018-04-15
    • 2014-06-07
    • 2021-11-05
    • 1970-01-01
    相关资源
    最近更新 更多