Requests
Requests copied to clipboard
SSL error with request_multiple but request is working fine
Hi I tried both methods Requests:get and Requests:post, both are working fine but I am getting error with request_multiple Method
<?php
$reqUrl = "https://httpbin.org/post";
$reqHeaders = [
'Accept' => 'application/json',
];
$reqData = [
[
'url' => $reqUrl,
'type' => Requests::POST,
'headers' => $reqHeaders,
'data' => [
'username' => "__api_username__",
'password' => "__api_password__",
'message' => "001 Hi from My Message!",
],
],
[
'url' => $reqUrl,
'type' => Requests::POST,
'headers' => $reqHeaders,
'data' => [
'username' => "__api_username__",
'password' => "__api_password__",
'message' => "002 Hi from My Message!",
],
],
];
$reqOpts = [
'timeout' => 300,
'verify' => false,
'complete' => 'my_callback',
];
// Setup a callback
function my_callback(&$request, $id) {
echo "Hi from My_Callback \n";
}
$responses = Requests::request_multiple($reqData, $reqOpts);
I am getting this error
object(Requests_Exception_Transport_cURL)#9 (10) {
["code":protected]=>
int(60)
["type":protected]=>
string(8) "cURLEasy"
["reason":protected]=>
string(63) "SSL certificate problem: unable to get local issuer certificate"
["data":protected]=>
resource(30) of type (Unknown)
["message":protected]=>
string(66) "60 SSL certificate problem: unable to get local issuer certificate"
["string":"Exception":private]=>
string(0) ""
["file":protected]=>
string(81) "M:\rajkiran.local\rkic\vendor\rmccue\requests\library\Requests\Transport\cURL.php"
["line":protected]=>
.
.
Thanks
same issue, can't figure it out, lloks like request_multiple does not consider verify/verifyname options in cUrl
@sergeliatko Hmm.. should this issue be re-opened ? Or maybe @shishtpal found a solution as they closed the issue themselves ?
Found a solution, will paste the code I have when on laptop