0

I am trying to perform a GET request to https web api from windows forms application. It is giving me error 'HTTPS handshake to xxx.xxx.com (for #28) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.'

But I can make the same GET call from browser window with out any problem.

What can I do?

serene
  • 685
  • 6
  • 16
  • Add `ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;` before the request. If you still receive the same response, add this right after `ServicePointManager.ServerCertificateValidationCallback = (s, cert, ch, sec) => { return true; };`. It's just for testing. You should validate the server's certicates for real. See [here](https://stackoverflow.com/a/48675492/7444103) a base validation process. – Jimi Jul 05 '19 at 17:47
  • This all assuming that you don't have a Proxy in between. – Jimi Jul 05 '19 at 17:54
  • thanks @Jimi , that worked for me. I ended up upgrading to newer .net framework. I was not aware of updated web server .net version. If you post it as answer I will mark mark it as answer for you. thanks again. – serene Jul 06 '19 at 01:45

0 Answers0