I get The request was aborted: Could not create SSL/TLS secure channel. Web form app is running on asp.net 4.8 version, the error occurs when sending request to payone api. The application is copied manually to server folder.
It works locally but on server it is throwing error. The suggested answers in similar questions is to add SecurityProtocolType
to Tls12
, which is already done before http call. Additionally in Global.asax
added following lines in Session_Start()
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ERROR :
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:
Line 101: Line 102: // The entire code base is synchronous, so keep it that way Line 103: var response = Client.client.SendAsync(request).Result; Line 104: if (!response.IsSuccessStatusCode) Line 105: {
One more things: Also followed this article to check Tls version on server, and by running [Net.ServicePointManager]::SecurityProtocol
in powershell, Tls12
is being displayed.
Can someone help identify where the problem is?
Version information:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0
Registry snapshot
Also added tls 1.2
manually in registry following this article.