问题描述
我在 Visual Studio 2017 中使用 Twilio REST 客户端.为 简单的短信自动回复,我无法再使用 Twilio REST API 从我的 ASP.net 应用程序发送短信.
I am using Twilio REST client in Visual Studio 2017. After adding a Studio Flow for a simple SMS autoresponder, I am no longer able to use the Twilio REST API to send a SMS message from my ASP.net app.
错误信息是需要升级"
at Twilio.Clients.TwilioRestClient.ProcessReponse(Reponse response)
at Twilio.Rest.Api.V2010.Account.MessageResource.Create(CreateMessageOptions options, ITwilioRestClient client)
at...
我已经尝试将 Twilio REST API 帮助程序库 NuGet 包升级到最新版本 5.28.0.
I already tried upgrading the Twilio REST API helper library NuGet package to latest, version 5.28.0.
错误发生在这个曾经可以工作的基本短信发送代码上.
The error occurs on this basic SMS sending code that used to work.
Dim message = MessageResource.Create(body:=strBody, from:=New Twilio.Types.PhoneNumber(Credentials.TwilioFixityNewNumberFormatted), [to]:=New Twilio.Types.PhoneNumber(strFormattedNumber))
Return message.Sid
我的 Twilio 帐户中没有错误消息或通知,说明出现问题或需要.有没有人遇到过这样的情况?
There are no error messages or notifications in my Twilio account that something is wrong or needed. Has anyone experienced something like this?
推荐答案
似乎修改 Twilio 项目使其成为受 TLS 1.2 要求约束的新"项目,该要求于 2019 年 3 月 28 日刚刚实施.通过将 Windows 和 .NET 更新到最新更新,并在访问 Twilio REST API 之前显式启用 TLS 1.2 解决了该问题:
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
这篇关于添加 Studio Flow 后,Twilio REST 客户端停止工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!