如何在使用wamp本地工作时摆脱payum“SSL证书问题:无法获取本地颁发者证书”错误

With payumBundle under symfony2, when trying to complete a payment on my local server with wamp and windows I get an error:

SSL certificate problem: unable to get local issuer certificate

I understood I could solve it by either:

  • download a certificate and set curl.cainfo=cacert.pem in php.ini PROBLEM : when I do so, the error does not disappear

  • set CURLOPT_SSL_VERIFYPEER option to false PROBLEM : Where do I do this with wamp/windows ?

I found a temporary fix :

update the vendor class

vendor/payum/core/Payum/Core/Bridge/Buzz/ClientFactory.php

and add the following code in the createCurl method:

    $client = new Curl();
    $client->setVerifyPeer(false);

Would be nice to find a way to update this from within the controller action... if someone has an idea, I'll take it!

EDIT : see the following answer which does it without modifying vendors :

Overload symfony2 vendor class to set curl verify_peer option to false