I'm working on a self-hosted WCF service for which encrypted communications is an option. Everything works fine when a certificate is already bound to the port as described here.
However, I want to avoid asking the user to run a command line tool. Is there a way the binding can be done programmatically? Perhaps using WMI?
Today, we'll answer one of the most common questions we get: “What port does SSL use?” Or, to put it other way that people ask: what are some of the most common SSL certificate port numbers that are used?” And the answer is none. SSL/TLS does not itself use any port — HTTPS uses port 443.
I believe the way to create an HTTP.SYS namespace reservation is through the HttpSetServiceConfiguration() unmanaged API; so you'll need some P/Invoke for that. There's some sample code that might be useful in one of Keith Brown's MSDN columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With