如何修复“无法建立SSL连接,请参阅内部异常".尝试下载osu时!头像 [英] How to fix "The SSL connection could not be established, see inner exception." when trying to download osu! avatar
问题描述
我想下载osu!头像以使用它们,但不断出现此错误:
I want to download osu! avatars to use them, but keep getting this error:
无法建立SSL连接.
The SSL connection could not be established.
内部例外是:
System.Net.Http.HttpRequestException:无法建立SSL连接,请参阅内部异常.---> System.Security.Authentication.AuthenticationException:验证失败,请参阅内部异常.---> System.ComponentModel.Win32Exception:Полученонепредвиденноесообщениеилионоимеетнеправильныйформат
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> System.ComponentModel.Win32Exception: Получено непредвиденное сообщение или оно имеет неправильный формат
示例网址: https://a.ppy.sh/10638551?1524507784.png
我尝试使用HttpClient和WebClient,但没有成功.
I tried using HttpClient and WebClient but without any success.
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);
}
推荐答案
答案:
一段时间后,我发现我使用的库有点不好.之后,我发现了硒.
考虑到这一点,我开始使用Selenium WebDriver并认为可以为所需页面拍摄屏幕截图,然后裁剪该图像并得到所需的内容.
因此,没有必要继续这个问题.
With that in mind i started using Selenium WebDriver and figured that i can take a screenshot of a page i needed, then i cropped that image and i got what i needed.
So theres no need to continue this issue.
这篇关于如何修复“无法建立SSL连接,请参阅内部异常".尝试下载osu时!头像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!