1,问题描述
默认情况下,IIS7 下面 HTTPS 绑定是无法指定主机名的。 如下图可以看到“主机名”这块是灰色不可编辑的。
2,解决办法
(1)我们可以通过手工修改 IIS 配置来实现主机头绑定。打开如下位置的文件。
注意:这个文件可以无法直接打开编辑(报文件不存在),可以先把它复制到桌面上去编辑,编辑完毕后再覆盖回去。
1 | C:\Windows\system32\inetsrv\config\applicationHost.config |
(2)找到如下节点位置:
1 2 3 4 5 6 7 8 | < bindings > < binding protocol = "net.tcp" bindingInformation = "808:*" /> < binding protocol = "net.pipe" bindingInformation = "*" /> < binding protocol = "net.msmq" bindingInformation = "localhost" /> < binding protocol = "msmq.formatname" bindingInformation = "localhost" /> < binding protocol = "http" bindingInformation = "*:80:www.hangge.com" /> < binding protocol = "https" bindingInformation = "*:443:" /> </ bindings > |
(3)我们将高亮的部分修改成如下配置:
这里的 www.hangge.com 要换成你自己的域名。
1 | <binding protocol = "https" bindingInformation= "*:443:www.hangge.com" /> |
(4)修改完毕后回到 IIS 这边(不用重启),可以看到主机名已经成功绑定上了。
原文出自:www.hangge.com 转载请保留原文链接:http://www.hangge.com/blog/cache/detail_1908.html