Skip to content
Snippets Groups Projects
Commit 768f3979 authored by Vincent Petry's avatar Vincent Petry
Browse files

Check for cert bundle existence before using it

parent 9323ba53
No related branches found
No related tags found
No related merge requests found
......@@ -198,12 +198,22 @@ class Storage extends DAV implements ISharedStorage {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, $this->certificateManager->getCertificateBundle());
$path = $this->certificateManager->getCertificateBundle();
if (is_readable($path)) {
curl_setopt($ch, CURLOPT_CAINFO, $path);
}
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$errorMessage = null;
if ($status === 0) {
$errorMessage = curl_error($ch);
}
curl_close($ch);
if ($errorMessage) {
throw new \Exception($errorMessage);
}
switch ($status) {
case 401:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment