# An existing connection was forcibly closed by the remote host

**URL:** <https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441>\
**Category:** API and Webhooks\
**Created:** [July 17, 2020, 2:44pm UTC](https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441 "2020-07-17T14:44:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shamil\_sayfutdinov](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@shamil\_sayfutdinov](https://devforum.zoom.us/u/shamil_sayfutdinov)\
**Post date:** [July 17, 2020, 2:44pm UTC](https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441/1 "2020-07-17T14:44:30Z")

</div>

I have a C# code that creates a meeting:  
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);  
request.Method = method;  
request.ContentType = “application/json”;  
request.ContentLength = bytes.Length;  
Stream dataStream = request.GetRequestStream();

On Windows Server 2019 Standard this code works fine in a console application and in a web application (IIS Version 1809).  
On Windows 10 Pro this code works fine in the console application. In the web application (IIS Version 1809) I get an error:  
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.  
—\> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.  
—\> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host  
at System.Net.Sockets.NetworkStream.Read(Byte buffer, Int32 offset, Int32 size)  
— End of inner exception stack trace —  
at System.Net.Sockets.NetworkStream.Read(Byte buffer, Int32 offset, Int32 size)  
at System.Net.FixedSizeReader.ReadPacket(Byte buffer, Int32 offset, Int32 count)  
at System.Net.Security.SslState.StartReceiveBlob(Byte buffer, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte buffer, AsyncProtocolRequest asyncRequest)  
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)  
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)  
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)  
at System.Net.TlsStream.Write(Byte buffer, Int32 offset, Int32 size)  
at System.Net.PooledStream.Write(Byte buffer, Int32 offset, Int32 size)  
at System.Net.ConnectStream.WriteHeaders(Boolean async)  
— End of inner exception stack trace —  
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)  
at System.Net.HttpWebRequest.GetRequestStream()

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
url = [https://api.zoom.us/v2/users/{userId}/meetings](https://api.zoom.us/v2/users/%7BuserId%7D/meetings)  
method = POST

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 22, 2020, 7:25am UTC](https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441/2 "2020-07-22T07:25:17Z")

</div>

Hey @shamil_sayfutdinov,

Please check these threads to see if they answer your question:

[https://devforum.zoom.us/search?q=An%20existing%20connection%20was%20forcibly%20closed%20by%20the%20remote%20host](https://devforum.zoom.us/search?q=An%20existing%20connection%20was%20forcibly%20closed%20by%20the%20remote%20host)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![shamil\_sayfutdinov](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@shamil\_sayfutdinov](https://devforum.zoom.us/u/shamil_sayfutdinov)\
**Post date:** [July 22, 2020, 9:35am UTC](https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441/3 "2020-07-22T09:35:04Z")

</div>

Thank you!

This advice helped:

> <https://stackoverflow.com/questions/2582036/an-existing-connection-was-forcibly-closed-by-the-remote-host/2582070#2582070>

Enable strong cryptography in your local machine or server in order to use TLS1.2 because by default it is disabled so only TLS1.0 is used.  
To enable strong cryptography , execute these commande in PowerShell with admin privileges:  
Set-ItemProperty -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

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 24, 2020, 9:04pm UTC](https://devforum.zoom.us/t/an-existing-connection-was-forcibly-closed-by-the-remote-host/24441/4 "2020-07-24T21:04:37Z")

</div>

Thank you for sharing your solution @shamil_sayfutdinov! 🙂

-Tommy
