使用Httpcfg配置具有SSL证书的端口 [英] Configure a Port with an SSL Certificate w\o using Httpcfg
问题描述
当开发自托管WCF http服务器时,
所需的步骤之一是将SSL证书绑定到端口号:
httpcfg set ssl -i 0.0.0.0:8012 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6
如:
http:// msdn .microsoft.com / zh-CN / library / ms733791.aspx
然而,
在我的部署环境中很难预料到能够做到这一点。
(我甚至不知道httpcfg.exe是否可再发行)
此外,如果用户在安装产品后更改了端口,那么他将需要再次运行该命令.... / p>
如何以编程方式自动执行此步骤?
最好是在C#中但是如果它只能在C ++中完成(直接访问Http Server API)
然后我将管理:)
对于那些在几年后调整的人:
这文章为http.sys api提供了一个干净的C#包装器。
When one develops a self-hosted WCF http server, one of the steps needed is to bind an SSL certificate to a port number: httpcfg set ssl -i 0.0.0.0:8012 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6 as stated in: http://msdn.microsoft.com/en-us/library/ms733791.aspx
However, It is hardly expected that in my deployment environment one would be able to do it. (I don't even know if the httpcfg.exe is redistributable) Moreover, if the user changed the port after he installed the product then he will need to run the command again....
how can this step be automated pro grammatically?
preferably in C# but if it can only be done in C++ (direct access to the Http Server API) then I will manage :)
For those tuning in a couple of years later:
This article from Mike Bouck's RAM has a clean C# wrapper for the http.sys api.
这篇关于使用Httpcfg配置具有SSL证书的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!