当前位置:网站首页>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
边栏推荐
- Cc2541 emulator CC debugger tutorial
- Quel est le fichier makefile?
- [tutorial] how to use GCC "zero assembly" for white whoring MDK
- What problems will you encounter when dialing VPS?
- Makefile文件是什么?
- Find the largest number of two-dimensional arrays
- Common formatting problems after word writing
- Easyswool environment configuration
- On LAN
- EBS:PO_ EMPLOYEE_ HIERARCHIES_ ALL
猜你喜欢

如何设置电脑ip?

leetcode:27. 移除元素【count remove小操作】
Unicorn bio raised $3.2 million to turn prototype equipment used to grow meat into commercial products

有哪些常见的代理ip问题?
![[assembly language] understand](/img/73/2483bca93714e378ff5eef18bddcd1.jpg)
[assembly language] understand "stack" from the lowest point of view

89 régression logistique prédiction de la réponse de l'utilisateur à l'image de l'utilisateur

Leetcode39 combined sum

001_redis设置存活时间

Analyze the three functions of static proxy IP.

拨号vps会遇到什么问题?
随机推荐
如何设置电脑ip?
What is BGP server and what are its advantages?
JDBC cannot connect to MySQL, and the error is access denied for user 'root' @ '* * *' (using password: Yes)
Makefile文件是什麼?
Shardingsphere broadcast table and binding table
Nanny level tutorial on building personal home page (II)
Shardingsphere read write separation
Time. In ANSI standard library H header file
App optimization and advanced scoreboard Part 2 [Mui + flask + mongodb]
Redis memory recycling strategy
Introduction to esp32 Bluetooth controller API
Introduction to micro build low code zero Foundation (lesson 2)
Why is one plus one equal to two
关于局域网浅谈
What is a dial-up server and what is its use?
VMware virtual machine installation openwrt as side route single arm route img image to vmdk
Under the pressure of sales, domestic mobile phones began to reduce prices, but they haven't put down their final face
代理IP可用率是不是等同于代理IP的效率?
拨号服务器是什么,有什么用处?
都是做全屋智能的,Aqara和HomeKit到底有什么不同?