curl
curl copied to clipboard
Curl certificate form Windows Server
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');
}
- You can obtain the certificate at http://curl.haxx.se/docs/caextract.html
- The piece of code above suggest creating a Curl/ folder at the component's root Directory
By the way, many thanks for this repo ;)