当前位置:网站首页>Tp6 Alibaba cloud SMS window reports curl error 60: SSL certificate problem: unable to get local issuer certificate
Tp6 Alibaba cloud SMS window reports curl error 60: SSL certificate problem: unable to get local issuer certificate
2022-04-23 02:07:00 【Yixi Muze】
order : Help customers receive an alicloud SMS verification code reminder , New version of the SDK, once , Torture is simple , stay Windows I was almost exhausted from work , I almost doubted myself , not so bad , Finish work
Code :
// Alibaba cloud SMS
public static function createClient($accessKeyId, $accessKeySecret){
$config = new Config([
"accessKeyId" => $accessKeyId,
"accessKeySecret" => $accessKeySecret
]);
// Domain name visited
$config -> endpoint = "dysmsapi.aliyuncs.com";
return new Dysmsapi($config);
}
public static function smsTemp($mobile,$code){
$client = self::createClient(SMS_ID,SMS_SECRET);
$sendSmsRequest = new SendSmsRequest([
"signName" => SIGN_NAME,
"templateCode" => SMS_CODE,
"phoneNumbers" => $mobile,
"templateParam" => "{\"code\":\"$code\"}"
]);
// Please print the copy code yourself API The return value of
return $client->sendSms($sendSmsRequest);
}
// test API
public function test($mobile,$code){
$res = self::smsTemp($mobile,$code);
if($res->body->code == "OK") {
return "success";
}
return 'fail';
}
CA certificate , Used to call HTTPS When it comes to resources , Verify that the other site is CA Issued certificates , It's not generated by itself ;
1、 Need to download CA certificate The file address is http://curl.haxx.se/ca/cacert.pem
2、 Put it in php Under the table of contents , And in php.ini Medium curl.cainfo Add path after :
curl.cainfo="D:\php\cacert.pem"
版权声明
本文为[Yixi Muze]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230207164932.html
边栏推荐
- 2022.4.22-----leetcode. three hundred and ninety-six
- 013_基于Session实现短信验证码登录流程分析
- Implementation of Base64 encoding / decoding in C language
- Realize linear regression with tensorflow (including problems and solutions in the process)
- Easyswool environment configuration
- Esp32 message queue using FreeRTOS
- Introduction to micro build low code zero Foundation (lesson 2)
- 89 logistic回歸用戶畫像用戶響應度預測
- How to configure iptables to realize local port forwarding
- PTA: 点赞狂魔
猜你喜欢
随机推荐
Numerical remapping method (remap)
Some tips for using proxy IP.
How does Axure set the content of the text box to the current date when the page is loaded
Nanny level tutorial on building personal home page (II)
010_StringRedisTemplate
BGP服务器在什么业务场景会被用到?
openstack 服务的启动
Lane cross domain problem
App optimization and advanced scoreboard Part 2 [Mui + flask + mongodb]
Wechat public platform test number application, authorized login function and single sign on using hbuilder X and wechat developer tools
世界读书日 | 技术人不要错过的好书(IT前沿技术)
A simple and open source navigation website source code
NPM yarn startup error [resolved]
What business scenarios will the BGP server be used in?
Analyze the advantages and disadvantages of tunnel proxy IP.
使用代理IP是需要注意什么?
浅析静态代理ip的三大作用。
Gray scale range corresponding to colors (red, yellow, green, blue, purple, pink, brick red and magenta) in HSV color space
On LAN
What categories do you need to know before using proxy IP?


![PTA: 浪漫倒影 [二叉树重建] [深度优先遍历]](/img/ae/a6681df6c3992c7fd588334623901c.png)






