.net core API Post exception gives NativeErrorCode 12175

前端 未结 1 2099
无人及你
无人及你 2020-12-17 05:20

for the code below, it catches an HttpRequestException/ System.Net.Http.WinHttpException when called

the exception states:

NativeErrorCode 12175   
M         


        
相关标签:
1条回答
  • 2020-12-17 05:43

    I talked with the owner of the server/service. They are providing a brand new service, and the service is currently using a self-signed certificate. Until the server/service is using a real certificate that can be verified via a certificate authority, Im going to bypass certificate verification in my code:

                using (var httpClientHandler = new HttpClientHandler())
                {
    
                    httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; };
                    using (var client = new HttpClient(httpClientHandler))
                    {
                        try
                        {
    
                            client.BaseAddress = new Uri("https://test-org.com/");
    
    0 讨论(0)
提交回复
热议问题