Twilio REST Client stops working after adding Studio Flow?

半腔热情 提交于 2019-12-05 21:48:19

It seems that modifying the Twilio project made it a "new" project subject to TLS 1.2 requirements that were just implemented on 3/28/19. The problem was solved by updating Windows and .NET to the latest updates, and explicitly enabling TLS 1.2 prior to accessing the Twilio REST API:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12   'Force TLS 1.2

Twilio returns Upgrade Required when you use an old TLS version. Setting the version directly using ServicePointManager.SecurityProtocol does fix it, but it's not a good idea since it'll become outdated when a new TLS version is released. Instead, see Transport Layer Security (TLS) best practices with the .NET Framework for some reasons it may be selecting an older version.

In my case it was due to this line in Web.config:

<httpRuntime targetFramework="4.5" />

Setting it to the actual .NET Framework version I'm using fixed the Twilio error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!