I found a lot of answers how to set httplistener up to use HTTPS, but each one solution requires the use of command line. I guess that is the fastest way to do it but I would li
You can load a certificate with:
X509Certificate cert = new X509Certificate2("MyCert.pfx");
And then install it:
X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
if (!store.Certificates.Contains(cert))
{
store.Add(cert);
}
store.Close();
Of course you might have to change the store name or location for your particular app.
For running the netsh command, you could look into creating and running a process (i.e. Process.Start) and run netsh.exe. Otherwise you have to mess with the Win32 HttpSetServiceConfiguration function, or the .NET equivalent if there is one.
You might find this codebox article useful: http://dotnetcodebox.blogspot.com/2012/01/how-to-work-with-ssl-certificate.html