Piwik\Http::configCurlCertificate PHP Method

configCurlCertificate() public static method

Will configure CURL handle $ch to use local list of Certificate Authorities,
public static configCurlCertificate ( &$ch )
    public static function configCurlCertificate(&$ch)
    {
        if (file_exists(PIWIK_INCLUDE_PATH . '/core/DataFiles/cacert.pem')) {
            @curl_setopt($ch, CURLOPT_CAINFO, PIWIK_INCLUDE_PATH . '/core/DataFiles/cacert.pem');
        }
    }

Usage Example

 private function getNewCurlHandle($url)
 {
     $ch = curl_init($url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     if ($this->acceptInvalidSSLCertificate) {
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     }
     curl_setopt($ch, CURLOPT_USERAGENT, Http::getUserAgent());
     Http::configCurlCertificate($ch);
     return $ch;
 }