SSL certificate: unable to get local issuer certificate on PHP 7.1 Ubuntu 16.04 NGINX -


i'm trying consume service on https through curl.

when exec following command in cli works fine.

curl --header "content-type: text/xml;charset=utf-8" --header "soapaction: createlabel" --data @testrequest.xml https://labelqa.estafeta.com/estafetalabel20/services/estafetalabelws?wsdl --cacert labelqa.estafeta.com.pem 

but when try use same in php, browser returns me error.

ssl certificate problem: unable local issuer certificate

i have following code.

$ch = curl_init("https://labelqa.estafeta.com/estafetalabel20/services/estafetalabelws?wsdl");  curl_setopt($ch, curlopt_postfields, "xmlrequest=testrequest.xml");  curl_setopt($ch, curlopt_httpheader, [     'content-type: text/xml;charset=utf-8',     'soapaction: createlabel', ]);  curl_setopt($ch, curlopt_returntransfer, 1);  curl_setopt($ch, curlopt_cainfo, 'labelqa.estafeta.com.crt');  $response = curl_exec($ch);  if (false === $response)     throw new exception(curl_error($ch), curl_errno($ch));  curl_close($ch);  print_r($response);  die; 

the call should made php's soapclient not work anyway because of same problem.

you can de labelqa.estafeta.com.crt cert downloading link https://labelqa.estafeta.com/estafetalabel20/services/estafetalabelws?wsdl.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -