Requests icon indicating copy to clipboard operation
Requests copied to clipboard

SSL error with request_multiple but request is working fine

Open shishtpal opened this issue 8 years ago • 3 comments

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

shishtpal avatar Aug 31 '18 15:08 shishtpal

same issue, can't figure it out, lloks like request_multiple does not consider verify/verifyname options in cUrl

sergeliatko avatar Jun 03 '23 14:06 sergeliatko

@sergeliatko Hmm.. should this issue be re-opened ? Or maybe @shishtpal found a solution as they closed the issue themselves ?

jrfnl avatar Jun 05 '23 10:06 jrfnl

Found a solution, will paste the code I have when on laptop

sergeliatko avatar Jun 05 '23 10:06 sergeliatko