Running a freshly created IdentityServer4 Asp.Net Core based server. It "works" in the sense that it has been working without HTTPS, both in calls to authenticate and also to serve up some Asp.Net MVC views. I switched it to use HTTPS for my local development environment, generating certificates as per this article.
From a browser, it "works". I'm able to do as that article suggests in the case of Chrome and bypass the security warning to get to the web views. However, from a .Net client I'm using the IdentityModel NuGet package and just trying to access the metadata using the Discovery Endpoint now fails. The server gives a "Failed to authenticate HTTPS connection" IOException, and the client gives a "Certificate authority is invalid or incorrect" HttpRequestException.
I'm guessing this is related to the fact that in the browser things are interactive and I'm able to tell it to ignore the warning and proceed. But in code, and using that library in particular, it is giving me that exception and not proceeding. Maybe.
Is there any way to handle this scenario of running IdentityServer4/AspNetCore with HTTPS and a self-signed cert better? Is there something that can be done with the DiscoveryClient that I'm not seeing?
This question is similar but the re-generation of the certificate did not help in this case. And I was wondering if there were other causes or insights from the IdentityServer / DiscoveryClient angle.