C# 调用第三方接口出现 The SSL connection could not be established

            Uri loginUrl = new Uri("http://192.211.146.69/test");
            HttpClientHandler clientHandlerLogin = new HttpClientHandler();
            clientHandlerLogin.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
            HttpClient clientLogin = new HttpClient(clientHandlerLogin);
            var loginResponse = await clientLogin.PostAsync(loginUrl, null);
            var loginResult = await loginResponse.Content.ReadAsStringAsync();

 

posted @ 2021-08-03 14:29  北极星下落不明  阅读(1010)  评论(0)    收藏  举报