Open razorness opened 8 years ago
A link to corresponding ticket in Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812708
I have this issue as well currently. How did you solve it?
The only way is to deactivate SSL and hope that the deb package maintainer will release a fixed version. :(
I've ben trying to find a way to deactivate it but could not find a working solution. Would you mind pointing me in the right direction?
Here is my code. The good news: I still use SSL. But I had to deactivate the chain of trust.
$klarna = new Klarna();
$klarna->config(
'id',
'secret',
'Country',
'Language',
'Currency',
Klarna::BETA,
// added this option in my fork to handle UTF-8 correctly
ini_get('default_charset')
);
/*
* Hackish way to deactivate Peer Verification for SSL
*/
$reflClass = new \ReflectionClass($klarna);
$reflProperty = $reflClass->getProperty('xmlrpc');
$reflProperty->setAccessible(true);
/** @var Client $xmlrpc */
$xmlrpc = $reflProperty->getValue($klarna);
$xmlrpc->setSSLVerifyPeer(false);
$reflProperty->setAccessible(false);
For the general problem, take also a look at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774882#34
That works great as a workaround. Thank you very much! 😄
BTW, this affects Ubuntu (14.04) as well.
This issue is not really related to Klarna/PHP-XMLRPC but I guess it's good to know:
This curl exception will be thrown:
CURL error: SSL certificate problem: unable to get local issuer certificate
when doing request as following:System:
Curl-Info from
php -i
:There seems to be no way to register a CA Root Certificate on the fly for requests against Klarna API. You need to set
curl.cainfo
for cURL inphp.ini
globally to resolve this issue sinceKlarna/XMLRPC/Klarna
isolates its instance ofPhpXmlRpc\Client
completely.