Generate a certificate and store it in the local computer's certificate store.
Then, use netsh
to assign the certificate to a port and application.
netsh http delete sslcert ipport=<hostname>:<port>
netsh http add sslcert ipport=<hostname>:<port> certhash=<certificate-thumbprint> appid=<appid>
For example:
netsh http delete sslcert ipport=0.0.0.0:44301
netsh http add sslcert ipport=0.0.0.0:44301 certhash=E8C4DF4BD68DB3735E874B68B4F3CAAABF8823AC appid={214124CD-D05B-4309-9AF9-9CAA44B2B74A}