ASP.NET - The request was aborted: Could not create SSL/TLS secure channel
-
09-06-2019 - |
Question
We get the following error;
The request was aborted: Could not create SSL/TLS secure channel
while using a WebRequest
object to make an HTTPS
request. The funny thing is that this only happens after a while, and is temporarily fixed when the application is restarted, which suggests that something is being filled to capacity or something.
Has anyone seen this kind of thing before?
Solution
I seem to recall having this problem last year. I suspect that you aren't closing your WebRequest objects properly, which is why after a certain amount of use it won't allow you to create any new connections.
OTHER TIPS
I have exactly the same problem! I send two requisitions to an HTTPS webservice in close period range (seconds). The first requisition works fine, but the second requisition fails.
I´ve tried to set "System.Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Ssl3", but the second requisition freezes...
I´m using VB.NET 2008.
Thanks
It looks like it may be a Conenction: Keep-alive thing: http://blogs.x2line.com/al/archive/2005/01/04/759.aspx#780
The similar problem for me fixed by:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;