From 9c5dc2fb6d1c0f1466c069bd94df8109c1664e13 Mon Sep 17 00:00:00 2001 From: Martin Hujer Date: Sat, 12 Mar 2016 20:06:06 +0100 Subject: [PATCH] use Kdyby/CurlCaBundle if available --- composer.json | 3 +++ src/FioApi/Downloader.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/composer.json b/composer.json index 147e824..8ac7ec8 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,9 @@ "squizlabs/php_codesniffer": "~2.3", "satooshi/php-coveralls": "^1.0" }, + "suggest": { + "kdyby/curl-ca-bundle": "~1.0" + }, "autoload": { "psr-4": { "FioApi\\": "src/FioApi" diff --git a/src/FioApi/Downloader.php b/src/FioApi/Downloader.php index 793ea68..98aa931 100644 --- a/src/FioApi/Downloader.php +++ b/src/FioApi/Downloader.php @@ -39,6 +39,10 @@ public function getCertificatePath() return $this->certificatePath; } + if (class_exists('\Kdyby\CurlCaBundle\CertificateHelper')) { + return \Kdyby\CurlCaBundle\CertificateHelper::getCaInfoFile(); + } + //Key downloaded from https://www.geotrust.com/resources/root-certificates/ return __DIR__ . '/keys/Geotrust_PCA_G3_Root.pem'; }