以编程方式添加在IIS 8 SNI选项结合选项、方式、IIS、SNI

2023-09-05 03:38:20 作者:不笑也倾城

我试图创建一个具有标志检查SNI(服务器名称指示)使用Microsoft.Web.Administration库(.NET框架)绑定的IIS 8。

I'm trying to create bindings for IIS 8 that have the flag SNI checked (Server Name Indication) using Microsoft.Web.Administration library (.NET Framework).

这是必要的,因为我想为IIS在同一个网站的多个SSL绑定,一切只使用一个IP地址。这是IIS 8的主要新特征之一。

This is necessary to me because I want to get multiple SSL bindings for the same website under IIS, all using just one IP address. This is one of the main new features of IIS 8.

我一直在寻找到Binding类,我找不到任何标志或选项,以表明它。

I've been looking into the Binding class and I can't find any flag or option to indicate it.

当前Microsoft.Web.Administration v 7.0.0.0这可能吗? 我需要,我还没有找到一个新的版本?

Is it possible with current Microsoft.Web.Administration v 7.0.0.0? Will I need a new version that I haven't found?

我知道,7.9.0.0版本只适用于IIS EX preSS,这是不是我的情况,所以我没有看进去。

I know that version 7.9.0.0 is only for IIS express, and it isn't my scenario, so I haven't looked into it.

推荐答案

我终于用做它的 Microsoft.Web.Administration 从文件夹%WINDIR%\ SYSTEM32 \ INETSRV \ ,但仅在Windows 8 / Windows的2012 与 IIS 8

I finally managed to do it using the Microsoft.Web.Administration from the folder %windir%\system32\inetsrv\ but only in Windows 8/Windows 2012 with IIS 8.

这些库曾在添加功能 BindingCollection 类。有没有从微软的文档还没有为这个新的重载,至少我还没有发现它。

These libraries had the SslFlags option in the Add function for BindingCollection class. There is no documentation from microsoft yet for this new overload, or at least I haven't found it.

SslFlags.Sni 可在这其中使用和创建与SNI结合检查完美。

The SslFlags.Sni is available to use in this one and creates the binding with SNI check perfectly.