-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
getUrlContent should verify the SSL certificate #7330
Conversation
In case of TLS connections is `getUrlContent` currently not verifying the SSL certificate if `curl` is not available. Additionally as a second layer of defense `CURLOPT_SSL_VERIFYPEER = true` is enforced, this should be anyways the default since cURL 7.10.
@VicDeo Could you use this function in the updater app, see https://github.com/owncloud/apps/blob/master/updater/lib/downloader.php#L68 ? |
@LukasReschke this will reintroduce #6910 |
@VicDeo Allright! Would be awesome if you could then implement the SSL verification manually :-) (e.g. copy paste it) |
There may be some reason where a SSL certificate check is not required, e.g. for the "Get from URL" function. However, this is subject to discussion and the certificate check is enabled by default.
@schiesbn I've added the possibility to disable the SSL check. As far I can see the "From URL" function ( core/apps/files/ajax/newfile.php Line 94 in 797e0a6
@karlitschek Would it be possible to add a matching SSL certificate to api.apps.owncloud.com? |
💣 Test Failed. 💣 |
💣 Test Failed. 💣 |
A new inspection was created. |
💣 Test Failed. 💣 |
@owncloud-bot Retest this please |
🚀 Test Passed. 🚀 |
Code looks good 👍 @VicDeo can you have a look as well ? |
No backport for this I'd say because it changes the public API. |
@VicDeo any update ? |
How is it determined whether a certificate is valid or not? Are the two implementations consistent with regards to this? The PHP documentation about verify_peer is not very clear about this and it actually sounds like cafile or capath must be specified with verify_peer. See http://www.php.net/manual/en/context.ssl.php Possibly unrelated: Do we also have to specify CN_match or is PHP intelligent enough to extract it from the URL? |
Besides these open questions, this patch looks good. 👍 |
Very good questions, because they showed that this PR will lead to problems
PHP => 5.6: Tries to use the system certificate store.
Awesome PHP madness again: PHP => 5.6: Does have sane defaults and will verify this. I will close this therefore for now and come up with a new PR which will Sent from mobile device How is it determined whether a certificate is valid or not? Are the two The PHP documentation about verify_peer is not very clear about this and it Possibly unrelated: Do we also have to specify CN_match or is PHP — |
In case of TLS connections is
getUrlContent
currently not verifying the SSL certificate ifcurl
is not available.Additionally as a second layer of defense
CURLOPT_SSL_VERIFYPEER = true
is enforced, this should be anyways the default since cURL 7.10.