首页 > 解决方案 > 将 SSL 与 IIS Express 一起使用

问题描述

我正在尝试使用假域名(bobby.fisher.com)在 localhost 上运行我的 VS 项目。为此,我在 applicationhost.config 文件中创建了一个虚拟目录,如下所示:

 <site name="Tidywork.Integrations.Web" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="C:\bobbyfisher\Workspaces\bobbyfisher.Integrations\bobbyfisher.Integrations\bobbyfisher.Integrations.Web" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:35464:localhost" />
      <binding protocol="http" bindingInformation="*:80:bobby.fisher.com" />
      <binding protocol="https" bindingInformation="*:44321:localhost" />
      <binding protocol="https" bindingInformation="*:44321:bobby.fisher.com" />
    </bindings>
  </site>

但是,当我尝试运行程序(https://bobby.fisher.com/)时,我遇到了一个错误:

This site can’t be reached
bobby.fisher.com refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

有没有人有任何建议如何做到这一点?

标签: iis-express

解决方案


如果您在访问站点时未在 URL 中指定端口,那么如果您选择https://(根据您的示例)浏览器将尝试自动连接端口 443 - 因为这是 HTTPS 的标准端口。

但是您尚未在 IIS 设置中配置该端口。因此,要么将该端口绑定到您的应用程序的 https,要么在您的 URL 中明确使用端口号(例如https://bobby.fisher.com:44321


推荐阅读