我们使用 IIS8.5,仅配置了默认网站,但在同一个负载平衡 IP 上有数千个域指向它。
我们计划为所有这些数千个域提供 https (SSL)。由于服务器名称指示 (SNI) 功能,所有 .pfx 证书都将存储在中央证书存储 (CCS) 中,并使用相同的 IP 绑定(bind)到相同的网站。
SNI 和 CCS 可以很好地用于此目的,但前提是我们为默认网站中的每个域添加明确的出价,这对于数千个域是不切实际的:
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
<binding protocol="https" bindingInformation="*:443:www.domain1.com.br" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:www.domain2.com.br" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:www.domain3.com.br" sslFlags="3" />
...
...
...
<binding protocol="https" bindingInformation="*:443:www.otherdomain9998.com.br" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:www.otherdomain9999.com.br" sslFlags="3" />
...
</bindings>
</site>
我尝试配置默认的 https 协议(protocol)绑定(bind),使用与默认 http 协议(protocol)绑定(bind)相同的方式并使用 sslFlags="3",这意味着 SNI+CCS:
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
<binding protocol="https" bindingInformation="*:443:" sslFlags="3" />
</bindings>
</site>
通过上述配置,没有 SSL 证书提供给任何浏览器。
有没有其他方法可以使用 SNI 和 CCS 为 https 配置默认网站?
如果能为我指明正确的方向,我将不胜感激。
谢谢!
吉列尔梅
最佳答案
案件已解决!
1) 首先,我使用 IIS 使用 SNI 和 CCS 在 www.whatever.com 的默认网站中创建了一个伪造的 SSL 绑定(bind)。
2) 然后我在 applicationHost.config 文件中手动编辑了这个伪造的绑定(bind)条目,如下所示:
来自:
<binding protocol="https" bindingInformation="*:443:www.whatever.com" sslFlags="3" />
收件人:
<binding protocol="https" bindingInformation="*:443:" sslFlags="3" />
3) 最后,我将证书发送到 CCS 文件夹。大约 5 分钟后,新的 SSL 站点被 IIS 自动激活。
换句话说,我得到了一个默认的 SSL 网站,在同一个 IP 中使用了许多证书,并且没有为每个证书创建绑定(bind)!
太棒了!!!
关于ssl - 如何使用 SNI 和 CCS 为 https 配置默认网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25412026/