项目之前发送短信是直接调用composer包(alibabacloud),但是在部署新环境时出现了报错
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
新环境没有配置证书,领导让暂时去除ssl验证, 不然如果下次部署新环境也会报错
'ignoreSSL' => true // 去除ssl证书验证
// 调用短信平台接口发送短信
$config = new AliConfig([
// 必填,您的 AccessKey ID
"accessKeyId" => AliYunMessage::KEY,
// 必填,您的 AccessKey Secret
"accessKeySecret" => AliYunMessage::SECRET
]);
$config->endpoint = AliYunMessage::ENDPOINT;
$client = new Dysmsapi($config);
$sendSmsRequest = new SendSmsRequest([
"phoneNumbers" => "$phone",
"signName" => "$signName",
"templateCode" => "$templateCode",
"templateParam" => "{\"name\":\"$name\",\"place\":\"$place\",\"time\":\"$time\"}"
]);
$runtime = new RuntimeOptions([
'ignoreSSL' => true // 去除ssl证书验证
]);
$resp = $client->sendSmsWithOptions($sendSmsRequest, $runtime);