When I create a starter ASP.NET Core project with HTTPS enabled, I get a "dual-mode" application which I can run as either self-hosted (via the console app) or IIS Express. A localhost certificate gets bound (visible via netsh) to a port on which the app will listen under IIS Express. However, in "self-hosted" mode, it will listen on port 5001, where no certificate appears in netsh. How does the self-hosted mode choose the appropriate certificate? When the time comes to deploy my application to my server, what steps are required to ensure that it all works? Do I simply adjust the "applicationUrl" property in launchSettings.json (assuming I have installed my certificate)? Do I need to bind it using netsh, and if not, why does netsh require the certificate to be uniquely identified (by thumbprint) when launchSettings doesn't?
I have a site certificate which I have installed and bound to port 5001 via netsh (basically what I've done before for an OWIN WebAPI application), sorted out routing and firewalling issues so that I can reference my stub site via https://www.{my-domain}:5001
. When I try browsing to my application via my site URL, it does land on my application page, but the browser reports an invalid certificate because the application is presenting the development localhost certificate, not the site certificate. What am I missing?