Search code examples
asp.nethttpwebrequest

The request was aborted: Could not create SSL/TLS secure channel - when using library from another solution


I'm using library to access a service on an https address. I've written a tester (in the same solution) and everything works ok.

now i've added my library as a reference to another project (ast.net web) and when I call the same method I get this as a response from the server.

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

the only difference is that my library is not in the solution but rather referenced.

What can be the issue and how can I resolve it ? I know I can disable the check - but the server is OK, it's something in my side.


Solution

  • System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    

    Solved this. Apparently the project used different defaults. not sure why.