Click here to Skip to main content
15,868,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Server Error in '/' Application.
The request was aborted: Could not create SSL/TLS secure channel.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[WebException: The request was aborted: Could not create SSL/TLS secure channel.]
   System.Net.HttpWebRequest.GetResponse() +1399
   FabricsPlusCom.ShoppingCartCheckout.SendtoEWAY() +1422
   FabricsPlusCom.ShoppingCartCheckout.ShowStep(Int32 TheStep) +5245
   FabricsPlusCom.ShoppingCartCheckout.btnNext_Click(Object sender, EventArgs e) +79
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9779798
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0


What I have tried:

Please help me. It's my first time to get this error. Does anybody have a suggestions?
Posted
Updated 23-Jul-20 18:59pm
Comments
Garth J Lancaster 23-Jul-20 22:06pm    
Catch-22 - you probably can't show us the code, yet we can't really help you unless we see the code. Maybe the party ?EWay to which you're sending the request has more information on setting up the SSL/TLS connection correctly, the use of (their) certificate or such
Member 14897481 2-Aug-20 2:45am    
Hello, which code do you want to see? is it from where I am getting that error which is shoppungcartcheckout.aspx or is it the default.aspx or the web.config?

1 solution

You need to make sure that the ServicePointManager settings (TLS/SSL based) are done before the HttpWebRequest is created.

Try like:
C#
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
       | SecurityProtocolType.Tls11
       | SecurityProtocolType.Tls12
       | SecurityProtocolType.Ssl3;

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.codeproject.com/api/")
 
Share this answer
 
Comments
Member 14897481 2-Aug-20 2:43am    
Hello, where do I place that?
Sandeep Mewara 2-Aug-20 4:49am    
As shown above, before HTTP request.
Member 14897481 2-Aug-20 5:13am    
Hello,

it seems like that error went away after I added this UnobtrusiveValidationMode="None"into the page directly. However it is not says
root element missing :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900