在IIS服务器上发布网站时,如果只是在本地使用的网站我们一般会用http,这个时候是可以随意修改主机名的;但是如果发布到公网上,要使用https时,就会发现主机名会变成灰色无法编辑。
无法编辑就没有主机名,没有主机名SSL证书就会对应不上,会提示证书错误,证书错误很多应用场景都没法正常使用,那么怎么解决这个问题呢
>>>>>
1. 在IIS里面,选择https,在选择相应的SSL证书,点击确定,保证网站设置完成,因为你一修改就要重新编辑主机名,会很麻烦
2. 打开C:\Windows\system32\inetsrv\config\applicationHost.config
3. 找到如下节点位置:
<bindings>
<binding protocol="http" bindingInformation="*:80:www.ZhaoGuzhoutest.cn" />
<binding protocol="http" bindingInformation="*:80:www.ZhaoGuzhoutest.cn" />
<binding protocol="https" bindingInformation="*:443:" />
</bindings>
</site>
可以看见代码里面的http是有主机名的,但是https没有,那么只要修改这里即可。
将“<binding protocol="https" bindingInformation="*:443:" />” 改为
“<binding protocol="https" bindingInformation="*:443:www.ZhaoGuzhoutest.cn" />”即可
其中的www.ZhaoGuzhoutest.cn就是你自己的主机名
修改完毕后 ,刷新一下网站就可以啦,当当当当~完美
本文详细介绍了在IIS服务器上配置HTTPS站点时,如何正确设置主机名来避免SSL证书匹配错误的问题。通过修改applicationHost.config文件中的bindingInformation字段,确保HTTPS站点能够正常运行。

1万+

被折叠的 条评论
为什么被折叠?



