我要下载osu!化身来使用它们,但不断出现此错误:



内部异常(exception)是:



网址示例:
https://a.ppy.sh/10638551?1524507784.png

我尝试使用HttpClient和WebClient,但没有成功。

using(HttpClient client = new HttpClient())
{
     var resp = await client.GetAsync("https://a.ppy.sh/10638551?1547998515.jpeg");
     var responseStr = await resp.Content.ReadAsStringAsync();
     File.WriteAllText("html/avatars/avatar.jpeg", responseStr);
}

最佳答案

我找到了此博客为我提供帮助的解决方案

ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) =>
{
    // local dev, just approve all certs
    if (development) return true;
    return errors == SslPolicyErrors.None ;
};
ojita

关于c# - 尝试下载osu时如何修复 "The SSL connection could not be established, see inner exception."!头像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54297514/

10-09 01:17