Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
bug #77 Use composer/ca-bundle for certificates checks (tucksaun)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.0-dev branch.

Discussion
----------

Use composer/ca-bundle for certificates checks

Should fix #75

Commits
-------

204c3ba Use composer/ca-bundle for certificates checks
  • Loading branch information
fabpot committed Mar 31, 2017
2 parents 04bb87f + 204c3ba commit 9e69edd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions SensioLabs/Security/Crawler/CurlCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace SensioLabs\Security\Crawler;

use Composer\CaBundle\CaBundle;
use SensioLabs\Security\Exception\RuntimeException;
use SensioLabs\Security\SecurityChecker;

Expand Down Expand Up @@ -49,6 +50,7 @@ protected function doCheck($lock, $certFile)
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_CAINFO, CaBundle::getSystemCaRootBundlePath());
curl_setopt($curl, CURLOPT_USERAGENT, sprintf('SecurityChecker-CLI/%s CURL PHP', SecurityChecker::VERSION));

$response = curl_exec($curl);
Expand Down
2 changes: 2 additions & 0 deletions SensioLabs/Security/Crawler/FileGetContentsCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace SensioLabs\Security\Crawler;

use Composer\CaBundle\CaBundle;
use SensioLabs\Security\Exception\RuntimeException;
use SensioLabs\Security\SecurityChecker;

Expand All @@ -37,6 +38,7 @@ protected function doCheck($lock, $certFile)
'user_agent' => sprintf('SecurityChecker-CLI/%s FGC PHP', SecurityChecker::VERSION),
),
'ssl' => array(
'cafile' => CaBundle::getSystemCaRootBundlePath(),
'verify_peer' => 1,
'verify_host' => 2,
),
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
}
],
"require": {
"symfony/console": "~2.7|~3.0"
"symfony/console": "~2.7|~3.0",
"composer/ca-bundle": "^1.0"
},
"bin": ["security-checker"],
"autoload": {
Expand Down

0 comments on commit 9e69edd

Please sign in to comment.