此站点无法提供安全连接

XuDong Peng-MSFT 10,176 信誉分 Microsoft 供应商
2024-03-12T03:20:11.2366667+00:00

嗨,大家好...

安装 Visual Studio 2019 后打开 Web 应用程序时收到此错误消息。

此站点无法提供安全连接

我尝试将我的 web.config 更改为以下内容,但失败了。

<rewrite>
  <rules>   
    <rule name="HTTP to HTTPS Redirect" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
         <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
      </conditions>
         <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
    </rule>
 </rules>
</rewrite>

Note: 该案例整理于:This site can’t provide a secure connection

Internet Information Services
0 个注释 无注释
{count} 票

接受的答案
  1. Zhi Lv - MSFT 32,021 信誉分 Microsoft 供应商
    2024-03-12T05:37:41.97+00:00

    你好,

    您可以在 Visual Studio 中右键单击您的应用程序,然后单击“属性”。

    然后点击“Web”选项卡,可以找到“Project Url”输入框。 将此输入框中的 url 从原来的 http://localhost:50997 更改为 https://localhost:44366

    119595-image.png

    之后,当您在 Visual Studio 中启动应用程序时,无需手动更改端口号。 它将自动使用“https://localhost:44366”进行浏览。


    如果答案是正确的解决方案,请单击“接受答案”并请投赞成票。如果您对此答案有其他疑问,请点击“评论”。

    注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知。

    最好的问候

    0 个注释 无注释

0 个其他答案

排序依据: 非常有帮助