In short
- Open cmd with admin rights
- Navigate to “C:\Program Files (x86)\IIS Express”
- Run
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:PORT/ -UseSelfSigned
changing PORT for the port you're trying to use.
c:\Program Files (x86)\IIS Express>IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44365/ -UseSelfSigned