A few weeks ago I had a PR merged with PowerShell Polaris to add HTTPS support. I thought it would be nice to share how to configure HTTPS with Polaris. PowerShell Polaris currently is using HTTPListener underneath the scenes. HTTPListener uses the kernel mode “http.sys” drivers from Windows. The SSL cert is actually bound to the port that HTTPListener will use. Currently, Linux’s port of HTTPListener does not support HTTPS. (Though, I believe there is an unsupported way to add the cert using reflection). I believe the easiest way to use HTTPS on a Linux machine, would be to proxy SSL with something like stunnel.
I created a script that generates a self-signed ssl cert, downloads the newest Polaris Release from GitHub, and starts Polaris. Your browser will not trust the cert by default. New-SelfSignedCertificate does not support adding certs to the CA Store in Windows. You can ignore the error, and add the cert by hand. I am using a trusted cert from ADCS when I am usually working with Polaris. I first was trying to use Add-NetIPHttpsCertBinding instead of netsh to add the binding. But, I kept getting a file not found error. I believe this is a bug since I tried this on several machines.