Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
设置“;“需要服务器名称指示”;使用c#使用Microsoft.web.Administration_C#_Iis - Fatal编程技术网

设置“;“需要服务器名称指示”;使用c#使用Microsoft.web.Administration

设置“;“需要服务器名称指示”;使用c#使用Microsoft.web.Administration,c#,iis,C#,Iis,任何人只要有一些代码,说明如何在IIS网站绑定上使用c#代码设置require SNI标志 我已经知道如何设置绑定: Binding newBinding = site.Bindings.CreateElement("binding"); newBinding["bindingInformation"] = bindingsString; newBinding["certificateHash"] = certificate.GetCertHashString(); newBinding["ce

任何人只要有一些代码,说明如何在IIS网站绑定上使用c#代码设置require SNI标志

我已经知道如何设置绑定:

Binding newBinding = site.Bindings.CreateElement("binding");
newBinding["bindingInformation"] = bindingsString;
newBinding["certificateHash"] = certificate.GetCertHashString();
newBinding["certificateStoreName"] = store.Name;
newBinding["protocol"] = "https";

我不确定设置SNI标志需要设置什么密钥。

我发现我们正在编辑位于%WinDir%\System32\Inetsrv\config的主机xml ApplicationHost.config文件

当设置被更改时,很容易看到哪些标志被更改。sslFlag=“1”是SNI必需的标志

  <binding protocol="https" bindingInformation="*:443:www.c1get.net" sslFlags="1" />

我在applicationHost.config中发现SNI已将Windows Server 2012上的SSL标志更改为3

<binding protocol="https" bindingInformation="*:443:example.com" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:www.example.com" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:example.net" sslFlags="3" />
<binding protocol="https" bindingInformation="*:443:www.example.net" sslFlags="3" />


需要测试这一点,我在使用2012 R2时,早些时候找到了答案,并使用sslFlag=“1”实现了所有功能。我使用sslFlags=3支持SNI。我从这个链接中找到了文档。谢谢你的链接。3表示集中存储。我不用那个。1对我来说是正确的