-
-
Notifications
You must be signed in to change notification settings - Fork 3
Curl can't find cainfo, when doing https request #1
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
Comments
Thank you for the info! I should state somewhere that ca certificate (or bundle) is necessary/mandatory for HTTPS. I'll also look into a workaround to not run into errors otherwise. |
This is actually handled over here: php-httpinterface/src/CurlHandle.php Line 121 in 339f552
I think the problem is rather that CURLOPT_SSL_VERIFYPEER is set to true by default, which then requires the cert- I think in an earlier version of the curl client i had this value depending on the existence of a cert.
|
The ca bundle is available on the system, and the connection works when i remove that line 121. I don't like your solution, i think only setting CURLOPT_CAINFO when $this->options->ca_info is a file would work better. When this is not specifically set the system default will be used. |
Oh right, i didn't think about the system CA. But what would be a reliable way to check that? Or should i drop the check at all and leave the problem up to the user (which makes up 99% of SO questions about edit: brrrrr https://github.com/guzzle/guzzle/blob/master/src/functions.php#L160 |
That function is only used in a very limited situation (streamHandler and php 5.?) For curl they do this: https://github.com/guzzle/guzzle/blob/master/src/Handler/CurlFactory.php#L326 I think that is the most flexible. Disabling CURLOPT_SSL_VERIFYPEER should be a last resort, maybe in the error message point to a checklist/steps to check/solve connection errors |
Thanks, looks good |
Disabling setting the CURLOPT_CAINFO option to null fixes this issue. Adding this option to the array only when ca_info is set should fix this issue.
The text was updated successfully, but these errors were encountered: