1

I try to call a remote REST Web API. My tests in Postman are successful. but in .Net Framework 4.5.2 and using a HttpClient I get this error:

The request was aborted. Could not create SSL/TLS secure channel.

As mentioned Here, I set the followings:

System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityPortocol = System.Net.SecurityProtocolType.Tls12;

Also, I tried this one

but nothing has changed.

thanks for any help in advanced!

Hamed
  • 105
  • 2
  • 15
  • So when you debugged both results with fiddler to check the differences, what did you find ? – TheGeneral Dec 11 '20 at 06:38
  • a key difference in raw requests! in postman raw request, the host is IP:443, but in .Net host is just IP (with no port Number!). I think the question has now changed to "How to set port Number in my .Net request?" Or "How postman connects to port 443 without any pointing to the it?!" – Hamed Dec 11 '20 at 17:05
  • Even, when I explicitly add port Number (443) to my client address, the host in raw request is Just IP(with No port Number!) – Hamed Dec 11 '20 at 17:50

0 Answers0