我知道有很多堆栈,但是我不知道
我有这段代码调用asp .net core 2 Web api(它不检查请求中的证书)
public async Task<List<LiasseDetails>> CreateLiasse(LiasseCreate liasseData)
{
using (var client = new HttpClient())
{
var uri = $"{_clusterLinuxUri}{_createPath}";
var httpResponse = await client
.PostAsJsonAsync(uri, liasseData)
.ConfigureAwait(false);
if (!httpResponse.IsSuccessStatusCode)
throw new Exception($"{nameof(CreateLiasse)} - error in CL");
return await httpResponse.Content
.ReadAsAsync<List<LiasseDetails>>()
.ConfigureAwait(false);
}
该呼叫在邮递员中正常运行(检查了相同的网址)
有什么想法可以调试吗?谢谢
编辑:添加此内容不会改变
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;