Skip to content

Instantly share code, notes, and snippets.

@evanscottgray
Last active January 10, 2017 07:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanscottgray/1be25c9c1eb4fe2cd50a to your computer and use it in GitHub Desktop.
Save evanscottgray/1be25c9c1eb4fe2cd50a to your computer and use it in GitHub Desktop.
forcing tls 1.2

Based on api docs here:

http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol(v=vs.110).aspx

You can set the following properties:

http://msdn.microsoft.com/en-us/library/system.net.securityprotocoltype(v=vs.110).aspx

you can force TLS 1.2

If you override the default which is just ssl, around these lines in these files:

https://github.com/restsharp/RestSharp/blob/3d6d0b1eebaddf5a3617a9dacea09704c5683f17/RestSharp/Http.Async.cs#L427

https://github.com/restsharp/RestSharp/blob/2d9c57e44ab823946506ee6be2dad3fa2c956993/RestSharp/Http.Sync.cs#L254

Adding in something like this somewhere, either in RestSharp or the twilio-csharp thing or your app might help:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment