Reputation: 123
I have an ASP.NET MVC application that makes call to an external service that support only TLS1.2 protocol.
When the code makes the call I get this error:
System.Net.Http.HttpRequestException HResult=0x80131500 Message=An error occurred while sending the request.
WebException: The request was aborted: Could not create SSL/TLS secure channel.
It seems that my side (the client one) does not support TLS1.2.
My question are:
Thanks, \sergio
Upvotes: 0
Views: 370
Reputation: 833
I think you can do this in code level with below line before calling web service
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12 ;
If you are not sure of the protocol you can use below
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
Upvotes: 1