web analytics

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

Options

codeling 1595 - 6639
@2019-04-14 12:39:53

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)
-----------------------------

 

@2019-04-14 12:42:19

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

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

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com