This is really a post in the category "I have seen this error before, too bad I didn't write something about it the last time I got it". So now I'm writing about it.
I have some super old legacy code, its a mich mach of Asp.net MVC, ASP.NET Web Forms that I don't care about and it just need to work for another year or so before I migrate some stuff. Today when I was doing some local development I got an error when trying to login to the site.
The request was aborted: Could not create SSL/TLS secure channel.
IOException: IDX20804: Unable to retrieve document from: 'https://mydomain.auth0.com/.well-known/openid-configuration'.
InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://lmydomain.auth0.com/.well-known/openid-configuration'.
I know this worked just a couple of weeks ago and I suppose it may have something to do with [https://community.auth0.com/t/upgrade-to-tls-1-2-what-actions-to-take/56547](Auth0 upgrade to TLS 1.2) but again, I don't care about this code and it works in prod so I haven't spent so much time digging into it.
Anyway, I found this [https://stackoverflow.com/questions/61261266/idx20803-unable-to-obtain-configuration-from-https-localhost-identityserver](question on Stack Overflow) and adding this to my Startup -> Configuration seems to have resolved the issue. I suppose it explicitly add support for higher versions of TLS or something. I don't know and I don't care.
ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;