Force TLS for REST requests

I needed to perform REST requests. The endpoint was an SSL secured site. When I issued the request using RestSharp I kept getting the following error:

Could not create SSL/TLS secure channel

It turned out that you have to force the framework to actually use TLS. I used this line to do so:

Please note that AFAIK this requires at least .NET 4.5

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.