curl icon indicating copy to clipboard operation
curl copied to clipboard

Curl certificate form Windows Server

Open guillemcanal opened this issue 13 years ago • 0 comments

In case Curl is used on Windows, it may be required to pass a certificate to the curl command like so :

In the set_request_options() method, found in the Curl class // Add certificate for Windows if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { curl_setopt($this->request, CURLOPT_CAINFO, dirname(FILE) . DIRECTORY_SEPARATOR . 'Curl' . DIRECTORY_SEPARATOR . 'cacert.pem'); }

  1. You can obtain the certificate at http://curl.haxx.se/docs/caextract.html
  2. The piece of code above suggest creating a Curl/ folder at the component's root Directory

By the way, many thanks for this repo ;)

guillemcanal avatar Dec 26 '12 18:12 guillemcanal