1

We currently use appcmd.exe to create IIS websites on the fly with the necessary http/https bindings, e.g.

appcmd add site /name:www.example.com /bindings:"http://www.example.com:80","https://www.example.com:443" /physicalPath:"c:\sites\www.example.com"

Is there a way to tell the https binding to use SNI?

We're using IIS8.5 / Windows 2012 R2

Dave Quested
  • 141
  • 2
  • [http://serverfault.com/questions/688178/command-line-to-set-up-sni-on-iis-for-windows-2012](http://serverfault.com/questions/688178/command-line-to-set-up-sni-on-iis-for-windows-2012) ? – krisFR Nov 18 '16 at 02:58
  • We want to achieve via appcmd, not possible? – Dave Quested Nov 18 '16 at 03:02
  • [https://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding#005](https://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding#005) SSL Flag is `1`. Try `appcmd add site /name:www.example.com /bindings:"http://www.example.com:80","https://www.example.com:443" /sslFlags:1 /physicalPath:"c:\sites\www.example.com` – krisFR Nov 18 '16 at 03:14
  • No luck, get... Unknown attribute "sslFlags" – Dave Quested Nov 22 '16 at 03:40

1 Answers1

0

I have yet to be able to determine the necessary delimiter to use when specifying the bindings attribute values with the add site appcmd, however I have accomplished this with the set site appcmd as follows:

appcmd set site /site.name:www.example.com /+bindings.[protocol='https',bindingInformation='*:443:www.example.com',sslFlags='1']

Seems like there should be a way to specify the sslFlags with the add site command as well, but I haven't figured it out yet.

Elliot Huffman
  • 1,229
  • 1
  • 12
  • 25
  • Unfortunately, this seems to create a binding with SNI enabled but no certificate selected. If I open IIS and open the binding information dialog, I have to select a certificate (despite exactly one exists that matches the created site domain). – Teejay Sep 05 '22 at 13:28