Powershell IIS7 管理单元将 SSL 证书分配给 https 绑定
作为自动化构建过程的一部分,我们使用 powershell 脚本废弃并重建 IIS 站点。
创建 AppPool 和包含绑定信息的网站后,我想为 https 绑定设置 SSL 证书。我在网上找不到任何具体的例子来证明这一点。
有什么想法吗?
寻找一位仁慈的powershell神...
As part of our automated build procedure we are trashing and reconstructing our IIS site with powershell scripts.
Once i have created the AppPool and the website complete with binding information I want to set the SSL certificate for the https binding. I can't find any concrete examples onl;ine anywhere that demonstrate this.
Any ideas?
Looking for a benevolent powershell god...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以将前面的示例与在网站中创建 https 绑定合并。
You can merge previous examples with creation of an https binding in a web site.
以下是简单的操作方法:
首先识别您要分配的证书并获取其指纹
,例如您的证书可能位于 cert:\LocalMachine\Root
您可以通过以下方式获取指纹:
<<<现在可以将证书分配给 IP 地址和端口 comme ci >>>
希望这对任何人都有帮助
Here is how to do it simply:
First identify thecertificate that you want to assign and obtain it's thumbprint
e.g. Your certificate might be in cert:\LocalMachine\Root
You can obtain the thumbprint with the following:
<<< Now one can assign the certificate to an ip address and port comme ci >>>
Hope this is of help to anyone
您可以使脚本更简单,如下所示:
使用 0.0.0.0 来定位所有托管 IP(相当于 IIS 管理器中的“*”)或根据需要将其替换为特定 IP。
You can make the script simpler like this:
Use 0.0.0.0 to target all hosted IP's (equivalent to "*" in IIS Manager) or replace it with a specific IP if needed.
我在这里找到了一个关于如何分配证书的示例。
http://learn.iis.net/page.aspx/491/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in/
但是,似乎没有非常优雅,必须对证书指纹进行硬编码
...所以如果有人知道更好的方法,我很高兴听到。
I've found an example here on how one can assign the certificate.
http://learn.iis.net/page.aspx/491/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in/
However, it doesn't seem very elegant having to hard code the certificate thumbprint
... so if any one knows of a better method, I'd be glad to hear.