我现在正在试用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?)
答案 0 :(得分:0)
很抱歉,无法正确读取错误消息,我已经通过将服务器的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