twilio-api - Twilio 验证 API 验证调用返回 curl 错误
问题描述
我现在正在尝试 Twilio 验证 API,指南实际上显示只有两次调用 API 以将 OTP 发送到目标电话号码并检查最终用户输入的 OTP 是否正确。我的验证代码部分有问题,它返回 curl 错误。
OTP 已成功发送到目标手机。
这是我用来检查 OTP 的 curl 命令:
curl -GET 'https://api.authy.com/protected/json/phones/verification/check' -d api_key=xxxx -d verification_code=xxxx-d phone_number=xx-d country_code=xx
这是错误消息:
curl: (58) could not load PEM client certificate, OpenSSL error error:02001002:system library:fopen:No such file or directory, (no key found, wrong pass phrase, or wrong file format?)
解决方案
抱歉没有正确阅读错误消息,我已经通过将服务器的 SSL 证书路径和私钥路径添加到 curl 命令来修复它并且它可以工作。
curl -GET 'https://api.authy.com/protected/json/phones/verification/check' -d api_key=xxxx -d verification_code=xxxx-d phone_number=xx-d country_code=xx --cert path/to/fullchain.pem --key path/to/privkey.pem
推荐阅读
- jquery - 使用 jQuery DateTimePicker 的 ASP.NET MVC Core DateTime 格式
- php - 如何在 Laravel SQL 查询的 where 子句中使用对象
- python - 无法理解用于制作服务器的 python 代码
- jhipster - 一对一映射是否应该让我添加更多条目?
- python - 使用烧瓶和 python 开发 Web 应用程序
- mysql - 从数据库中选择最新的历史记录
- php - 无法将多选数据存储到数据库
- kotlin - 智能投射 Arrow-kt 选项
- javascript - 用于展开所有页面链接的 Chrome 小书签
- c++ - BLE 标头 Nordic nRF52832 中的连接句柄 ID 出错