When calling Third Party API getting error Authentication failed because the remote party has closed the transport stream.
Sourabh Salve
1
Reputation point
- I have upgraded our aws ec2 instance Windows 2012 r2 to Windows 2016 to support TLS 1.2 ciphers and also enable only TLS1.2 protocol using registry but still I am facing same error.
- Also I have added "SystemDefaultTlsVersions" = dword:00000001 and "SchUseStrongCrypto" = dword:00000001 in respective registry.
- On "https://www.ssllabs.com/ssltest/ " also it showing A+ grade.
- It is not possible for us to change in code and redeploy it on production server.
- In web.config file httpruntime and compilation targetFramework is 4.5
- Also I had added below code in "ApplicationHost.config" file, <configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>
</configuration>. But because of this, IIS was stopped working and was not able to start. so I revert this change.
I am trying to solve this error from January End and tried all possibilities but not able to solve this error.
"System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult) at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)"
Please help me on this issue.
Sign in to answer