Error while using HTTP::configCurlCertificate()

(Tassoman) #1


I’m writing a plugin that tries to check APIs values between production and staging environments Piwik’s installations. The environments are under SSL so I need a curl certificate to get things done.

This is part of the code I’m writing:

HTTP::configCurlCertificate('/opt/staging.pem'); HTTP::fetchRemoteFile($stagingUrl . $params);

PHPStorm and php console raise an exception: Only variables can be passed by reference (in the first line of code I’ve cited before)

Any hint how to tell curl to use certificate.pem file?

There’s also the unsafe option to ignore certificates validation, but I really wouldn’t.

(Matthieu Aubry) #2

Hi Tassoman,

I checked our Http class and it’s not possible yet to specify a custom certificate file.