c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
asp.net MVC

The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net

| | ASP , ASP-NET , MVC

I got this following error "Could not create SSL/TLS secure channel" in your ASP.NET MVC WebClient application.

The Request was aborted

CODE:

    WebClient webClient = new WebClient();

string content = webClient.DownloadString(url);
HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(content);

SOLUTION:

Client servers might supported by SSL/TLS protocol versions. So you may specify the SSL/TLS protocol version in your code.

    WebClient webClient = new WebClient();

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
string content = webClient.DownloadString(url);
HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(content);

VIDEO GUIDE: