There are many questions like this, but answers which should help me, they did not do that.
private static string GetWebText(Uri url)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
request.UserAgent = "A .NET Web Crawler";
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
string htmlText = reader.ReadToEnd();
return htmlText;
}
This is my code, and when I am trying to request some URL, I am getting
The request was aborted: Could not create SSL/TLS secure channel
Someone could help me? I am missing something?
The same URL which I am trying to request, working in Browser.
Thanks!