asp.net core IHttpClientFactroy 进行SSL(https)请求时注入ConfigurePrimaryHttpMessageHandler解决https请求错误

builder.Services.AddHttpClient("https").ConfigurePrimaryHttpMessageHandler(c =>
{
var hander = new HttpClientHandler();
hander.ServerCertificateCustomValidationCallback = (message, cert, chain, error) => true;
return hander;
});

posted on 2022-03-21 21:56  跨界农民工  阅读(356)  评论(0编辑  收藏  举报

导航