How do I add SSL to a .net application that uses httplistener - it will *not* be running on IIS

前端 未结 6 1228
無奈伤痛
無奈伤痛 2020-12-12 20:57

Most recent edits in bold I am using the .net HttpListener class, but I won\'t be running this application on IIS and am not using ASP.net. Th

6条回答
  •  天命终不由人
    2020-12-12 21:30

    Here is an alternative way to bind the SSL certifiate to the IP/PORT combination without using httpcfg.exe (XP) or netsh.exe (Vista+).

    http://dotnetcodebox.blogspot.com.au/2012/01/how-to-work-with-ssl-certificate.html

    The gist of it is that you can use a C++ HttpSetServiceConfiguration API in-built into windows to do it programatically rather than via the command line, hence removing dependency on the OS and having httpcfg installed.

提交回复
热议问题