My ASP.NET core client app generates an error.
When debugged, it fails in the HttpResponseMessage line
...
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(tokenEndpoint, content);
...
With error:
SSL connection could not be established: AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch.
The tokenEndpoint is correct, I don’t get any response errors (401, 403..etc) to help me troubleshoot possible code related stuff.
If I run the test using Postman, it works fine.
Trying to understand the difference, the only thing I see is that postman have “SSL configuration” off and “ca certificate” off (by default)
I even exported the cert from server (where the API is running) and import it to client were running the ASP.NET client app——no luck 🙁
So at this time my question is,
why postman does not complaint about cert mismatch?