New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for CURLOPT_CAINFO #1306
Comments
You can use the |
I actually tried that and it didn't work. I thought it was for Here is how I called it: $res = $client->request('GET', ZDURL . '/organizations.json', ['auth' => Here is the error: Fatal error: Uncaught exception What does work is if I modify CurlFactory.php directly, I add a single
'C:\Users\Jose\Documents\Development\Php\EnsimZendesk\cacert.pem', On 11/11/2015 10:25 PM, Jeremy Lindblom wrote:
|
I looked at the code further, and the 'cert' option only sets the I think this needs to be supported in future version. Thanks, On 11/11/2015 10:25 PM, Jeremy Lindblom wrote:
|
I added this code to applyHandlerOptions in CurlFactory.php and now it works by specifying 'cainfo' option. Probably should iimplement CURLOPT_CAPATH as well.
|
Oh, my bad on Those are both "request options", but can be applied to every request as explained in the bottom of the client creation section, "All other options passed to the constructor are used as default request options with every request created by the client." |
Yep, this is done using |
solution1: disable ssl verification $client->request('GET', '/', [
'curl' => [
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
],
//other parameters
'headers' => [
'Authorization' => 'Basic '.$this->token,
],
'multipart' => [
[
'name' => 'file',
'contents' => fopen($uploadFilePath, 'r')
],
]
]); solution2: specify a cacert.pem file $client->request('GET', '/', [
'curl' => [
CURLOPT_CAINFO => '/path/to/cacert.pem'
],
//other parameters
'headers' => [
'Authorization' => 'Basic '.$this->token,
],
'multipart' => [
[
'name' => 'file',
'contents' => fopen($uploadFilePath, 'r')
],
]
]); sulation3: specify default cainfo in [curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = /path/to/cacert.pem I'm not sure if it needs a double quote like this |
Need to be able to support CURLOPT_CAINFO to allow loading of cacert file. In some cases, this is needed, in my case it is needed while running on a windows machine. php curl on Windows seems to have a problem with SSL requests unless CURLOPT_CAINFO is specified.
The text was updated successfully, but these errors were encountered: