Getting this error in a .NET Core web app? In this case we were trying to ping Zapier.

Server Error in ‘/’ Application.
The remote server returned an error: (500) Internal Server Error.
Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
Stack Trace:
[WebException: The remote server returned an error: (500) Internal Server Error.]
System.Net.WebClient.OpenRead(Uri address) +521

or

An unhandled exception occurred while processing the request.
IOException: Authentication failed because the remote party has closed the transport stream.
System.Net.Security.SslStream.StartReadFrame(byte[] buffer, int readBytes, AsyncProtocolRequest asyncRequest)

HttpRequestException: The SSL connection could not be established, see inner exception.
System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)

WebException: The SSL connection could not be established, see inner exception. Authentication failed because the remote party has closed the transport stream.
System.Net.HttpWebRequest.GetResponse()

In my case this was due to TLS settings. In a previous time we had explicitly set the TLS version like this:

ServicePointManager.SecurityProtocol = (SecurityProtocolType)768; // 1.1=768, 1.2=3072 TLS versions

Because of earlier incompatibilities. Now of course that version of TLS is old, and Zapier stopped accepting it a little while ago. The best option is not to specify TLS unless you have to – just remove the setting to allow the app to choose the correct TLS automatically.

Last modified: April 2, 2020

Author

Comments

Write a Reply or Comment

Your email address will not be published.