The request was aborted: Could not create SSL/TLS secure channel [Solved] Options

codeling Posts: 1087 Points: 4560
Posted: Sunday, April 14, 2019 12:39:53 PM

The following exception is thrown when trying to download a file using the following statement from a https url in my ASP.NET web application:

The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadData(Uri address)
   at Canaware.Forum.Pages.ForumPage.UpdateMesasgeResources(HtmlDocument htmlDocument, Int64 messageId)
   at Canaware.Forum.Pages.postmessage.PostReply_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
-----------------------------

 

 

codeling Posts: 1087 Points: 4560
Posted: Sunday, April 14, 2019 12:42:19 PM

Add the below code in web application's Global.asax Application_Start():

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

Users browsing this topic
Guest