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();

浙公网安备 33010602011771号