. Advertisement .
..3..
. Advertisement .
..4..
”An existing connection was forcibly closed by the remote host” is a common error. In this post, we will give you some best ways to solve it. Let’s read to get more knowledge!
Here is the detail of the error:
An existing connection was forcibly closed by the remote host
Reason
Your error comes from some following reasons:
- The format of data you are providing to the application is not correct, it provides an HTTPS request for an HTTP server.
- The network connection between the client and the server is interrupted.
- The third-party application is faulty because you cause a problem for it.
- The system resources of third-party application is run out of.
Solution
You should active Wireshark to determine what is happening.
Then, let’s use TLS 1.2 for your application ( you have to ensure that it runs well before calling your service):
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
To use TLS1.2, you need to open strong cryptography on your local workstation or server, as it is disabled by default and only TLS1.0 is used. Follow these commands to do that:
rty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
Finally, let’s restart your computer to get effective changes.
Conclusion
Through above article, we have given you some ways to handle: ”An existing connection was forcibly closed by the remote host”. We hope that they will be useful for you. If you have any difficulties or questions, please leave us a message. Thanks for reading!
Leave a comment